/* 孩子学习站样式:手机优先,电脑端自动变宽 */
:root {
  --bg: #f6f4ff;
  --card: #ffffff;
  --ink: #2b2a3a;
  --muted: #7a7891;
  --line: #e6e3f5;
  --brand: #6c5ce7;
  --good: #1fa971;
  --good-bg: #e5f8ef;
  --bad: #e5484d;
  --bad-bg: #ffecec;
  --mc: var(--brand);
  --r: 18px;
  --shadow: 0 4px 16px rgba(80, 60, 160, .09);
  --nav-h: 62px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden; overflow-wrap: anywhere;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 10px);
}
body[data-mod="amc"] { --mc: #6c5ce7; }
body[data-mod="math"] { --mc: #f39c12; }
body[data-mod="science"] { --mc: #00a884; }
body[data-mod="vocab"] { --mc: #e84393; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
img { max-width: 100%; }

/* ---------- 顶栏 ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 17px; min-width: 0; }
.brand .logo { font-size: 24px; }
.brand .bname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tbtn {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 700; color: var(--muted);
}
.tbtn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.who {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 6px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: color-mix(in srgb, var(--pc, var(--brand)) 15%, #fff); border: 1.5px solid var(--pc, var(--brand));
}

/* ---------- 底部导航(手机) ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(80, 60, 160, .07);
}
.tabs a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--muted); font-size: 11px; font-weight: 700; --mc: var(--brand); }
.tabs a i { font-style: normal; font-size: 21px; filter: grayscale(.6); }
.tabs a span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.tabs a.on { color: var(--mc); }
.tabs a.on i { filter: none; transform: translateY(-1px) scale(1.1); }

.wrap { max-width: 760px; margin: 0 auto; padding: 14px 14px 24px; }

/* ---------- 通用组件 ---------- */
.ptitle { font-size: 22px; margin: 4px 0 12px; }
.sec { font-size: 15px; color: var(--muted); margin: 20px 0 8px; font-weight: 700; }
.card { background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.card h3 { font-size: 14px; color: var(--muted); margin: 10px 0 8px; font-weight: 700; }
.card h3:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.tip { font-size: 13px; margin-top: 24px; }
.notice { background: #fff6dd; border: 1px solid #f5dc8a; border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.l1 { display: block; }
.l2 { display: block; color: var(--muted); font-size: .86em; margin-top: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 14px; padding: 11px 18px; font-weight: 800;
  background: var(--mc); color: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .15); transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.btn.big { display: flex; width: 100%; margin: 10px 0; padding: 14px 18px; font-size: 17px; }
.btn.small { padding: 6px 12px; font-size: 14px; border-radius: 12px; }
.btn.ghost { background: #fff; color: var(--mc); border: 2px solid var(--mc); box-shadow: none; }
.btn.good { background: var(--good); }
.btn:disabled { opacity: .4; cursor: default; }
.link { background: none; border: 0; padding: 6px 2px; color: var(--mc); font-weight: 700; font-size: 14px; }
.link.danger { color: var(--bad); font-weight: 600; font-size: 13px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.row2 .btn { width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 14px; color: var(--muted); }
.chip.on { background: color-mix(in srgb, var(--mc) 14%, #fff); border-color: var(--mc); color: var(--mc); }
.tabsrow { margin-bottom: 8px; }

.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 6px 0 12px; }
.bar i { display: block; height: 100%; background: var(--mc); border-radius: 99px; transition: width .3s; }

.qhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); font-size: 14px; }
.statrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 14px; }
.srow { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.srow:last-child { border-bottom: 0; }

.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tag { background: color-mix(in srgb, var(--mc) 14%, #fff); color: var(--mc); font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 999px; }
.tag.lv2 { background: #fff1d6; color: #b9770e; }
.tag.lv3 { background: #ffe3e6; color: #c0392b; }

/* ---------- 首页 ---------- */
.hero { background: linear-gradient(135deg, #7c6cf0, #b06cf0 55%, #ff8fb1); color: #fff; border-radius: 22px; padding: 20px 18px; box-shadow: var(--shadow); }
.hero h1 { font-size: 26px; }
.hero p { margin: 6px 0 0; opacity: .92; }
.pgrid, .mgrid, .sgrid, .tgrid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.pcard {
  position: relative; text-align: center; background: #fff; border: 3px solid transparent; border-radius: 22px; padding: 14px 10px 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0;
}
.pcard.on { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 8%, #fff); }
.pcard .avatar { font-size: 46px; line-height: 1.1; }
.pcard .pname { font-size: 19px; font-weight: 800; }
.pcard .badge { position: absolute; top: 8px; right: 8px; background: var(--pc); color: #fff; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 99px; }
.pstats { list-style: none; padding: 0; margin: 6px 0 0; text-align: left; width: 100%; font-size: 12px; color: var(--muted); }
.pstats li { display: flex; gap: 4px; align-items: flex-start; padding: 2px 0; }
.pstats i { font-style: normal; flex: none; }
.mcard, .tcard, .scard {
  background: #fff; border-radius: 20px; padding: 14px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 3px; border: 0; text-align: left; min-width: 0;
  border-top: 5px solid var(--mc); transition: transform .12s;
}
.mcard:active, .tcard:active, .scard:active, .pcard:active { transform: scale(.97); }
.micon { font-size: 34px; line-height: 1.1; }
.mtitle { font-weight: 800; font-size: 16px; }
.mdesc { color: var(--muted); font-size: 12.5px; }
.tcard .bar { width: 100%; }

/* ---------- 做题 ---------- */
.qcard { margin-top: 4px; }
.qtext { font-size: 18px; font-weight: 600; line-height: 1.5; }
.qtext.small { font-size: 15px; }
.qtext .l2 { font-weight: 400; font-size: .88em; margin-top: 6px; }
.bi .l2 { margin-top: 4px; }
.choices { display: grid; gap: 9px; margin: 8px 0; }
.choice {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 11px 12px; font-size: 17px;
  box-shadow: 0 2px 0 var(--line);
}
.choice b { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--mc) 14%, #fff); color: var(--mc); font-size: 15px; }
.choice span { min-width: 0; flex: 1; }
.choice:not(:disabled):hover { border-color: var(--mc); }
.choice.correct { border-color: var(--good); background: var(--good-bg); }
.choice.correct b { background: var(--good); color: #fff; }
.choice.wrong { border-color: var(--bad); background: var(--bad-bg); }
.choice.wrong b { background: var(--bad); color: #fff; }
.choice:disabled { cursor: default; color: var(--ink); }
.feedback { border-radius: 14px; padding: 10px 14px; margin: 10px 0; }
.feedback.ok { background: var(--good-bg); color: #0d6b45; }
.feedback.bad { background: var(--bad-bg); color: #a02025; }
.feedback .bi { color: var(--ink); margin-top: 6px; font-size: 15px; }
.explain { font-size: 15px; }
.witem { position: relative; }
.done { text-align: center; padding: 24px 14px; }
.bigemoji { font-size: 60px; }
.score { font-size: 22px; font-weight: 800; color: var(--mc); margin: 6px 0; }

.mprompt { font-size: 30px; font-weight: 800; text-align: center; padding: 14px 0; }
.mprompt .expr { display: block; letter-spacing: .5px; }
.mprompt .wtext { font-size: 18px; font-weight: 600; text-align: left; line-height: 1.5; }
.mprompt .wtext .l2 { font-weight: 400; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.15; margin: 0 .12em; font-size: .85em; }
.frac > span:first-child { border-bottom: 2.5px solid currentColor; padding: 0 .25em; }
.ansrow { display: flex; gap: 8px; margin-top: 8px; }
.ansrow input { flex: 1; min-width: 0; border: 2px solid var(--line); border-radius: 14px; padding: 11px 14px; font-size: 20px; font-weight: 700; text-align: center; background: #fff; }
.ansrow input:focus { outline: 0; border-color: var(--mc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mc) 20%, transparent); }
.ansrow input:disabled { background: #f3f2fa; color: var(--ink); }

/* ---------- 科学 ---------- */
.sgrid .scard { align-items: center; text-align: center; position: relative; }
.cicon { font-size: 44px; line-height: 1.1; }
.cicon.big { font-size: 64px; display: block; margin-bottom: 8px; }
.cimg { width: 64px; height: 64px; object-fit: contain; }
.cimg.big { width: 110px; height: 110px; }
.stitle { font-weight: 800; }
.sbadge { margin-top: 4px; font-size: 12px; font-weight: 800; background: #eef6f3; color: #00805f; border-radius: 99px; padding: 1px 10px; }
.scard.done { background: #f1fbf7; }
.khero { text-align: center; margin-bottom: 10px; }
.khero h2 { font-size: 22px; }
.para { font-size: 16px; margin: 10px 0; line-height: 1.6; }
.para .l2 { font-size: .9em; }
.fact { background: #fff8e1; border-left: 5px solid #ffc83d; border-radius: 12px; padding: 10px 12px; margin-top: 12px; font-size: 15px; }

/* ---------- 单词 ---------- */
.tcard { align-items: flex-start; }
.bigopt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 14px; margin: 10px 0; box-shadow: var(--shadow); }
.bigopt small { color: var(--muted); font-size: 13px; }
.flip {
  display: block; width: 100%; min-height: 270px; margin: 12px 0 6px; border: 3px solid var(--mc); border-radius: 24px; background: #fff; padding: 18px 14px; box-shadow: var(--shadow); cursor: pointer;
  text-align: center; user-select: none; -webkit-user-select: none;
}
.flip.back { background: color-mix(in srgb, var(--mc) 7%, #fff); }
.face { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 230px; }
.wemoji { font-size: 64px; line-height: 1.1; }
.wemoji.big { font-size: 72px; text-align: center; }
.wen { font-size: 40px; font-weight: 800; letter-spacing: 1px; }
.wzh { font-size: 28px; font-weight: 800; text-align: center; }
.wex { font-size: 16px; margin-top: 6px; }
.speak { border: 2px solid var(--mc); background: #fff; color: var(--mc); border-radius: 99px; padding: 6px 16px; font-weight: 800; }
.spellq { text-align: center; }
.spellq .wex { text-align: center; }

/* ---------- 电脑端 ---------- */
@media (min-width: 701px) {
  body { padding-bottom: 20px; }
  .top { padding: 10px max(16px, calc((100vw - 980px) / 2)); }
  .tabs {
    position: sticky; top: 53px; bottom: auto; height: auto; justify-content: center; gap: 6px; padding: 6px 12px;
    box-shadow: none; background: rgba(255, 255, 255, .85); backdrop-filter: blur(8px); border-top: 0; border-bottom: 1px solid var(--line);
  }
  .tabs a { flex: 0 0 auto; flex-direction: row; gap: 6px; font-size: 14px; padding: 6px 16px; border-radius: 999px; }
  .tabs a i { font-size: 18px; }
  .tabs a.on { background: color-mix(in srgb, var(--mc) 13%, #fff); }
  .wrap { max-width: 980px; padding: 20px 20px 40px; }
  .pgrid { grid-template-columns: repeat(2, 1fr); }
  .mgrid { grid-template-columns: repeat(4, 1fr); }
  .sgrid { grid-template-columns: repeat(4, 1fr); }
  .tgrid { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 28px 28px; }
  .hero h1 { font-size: 32px; }
  .mod { max-width: 720px; margin: 0 auto; }
  .mod.science .sgrid, .mod.vocab .tgrid { max-width: none; }
  .mod.science, .mod.vocab { max-width: 900px; }
  .choice:not(:disabled):hover { transform: translateY(-1px); }
  .mcard:hover, .tcard:hover, .scard:hover, .pcard:hover { transform: translateY(-3px); }
  .btn.big { max-width: 420px; margin-left: auto; margin-right: auto; }
}
@media (max-width: 360px) {
  .brand .bname { display: none; }
  .wen { font-size: 34px; }
  .mprompt { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* =====================================================================
   v2 新增:档位按钮、讲解课、分步详解、错题对比、AI 小课堂、阿语乐园
   ===================================================================== */
:root { --ar-font: "Geeza Pro", "Al Nile", "Traditional Arabic", "Segoe UI", "Noto Naskh Arabic", "Droid Arabic Naskh", "Arial", serif; }

/* 顶栏:档位按钮,窄屏隐藏站名防止挤出屏幕 */
.tbtn.tier { background: #fff3d6; border-color: #f0c36a; color: #8a5a00; }
@media (max-width: 440px) {
  .brand .bname { display: none; }
  .top { padding: 8px 10px; gap: 6px; }
  .tools { gap: 4px; }
  .tbtn { padding: 4px 8px; font-size: 12px; }
  .who { padding: 3px 8px 3px 5px; font-size: 12px; }
}
.tabs a { font-size: 10.5px; }
.tabs a span { padding: 0; }

/* 首页 */
.ptier { font-size: 12px; font-weight: 800; color: var(--pc); background: color-mix(in srgb, var(--pc) 13%, #fff); border-radius: 99px; padding: 1px 10px; }
.pstat { font-size: 12px; color: var(--muted); margin-top: 4px; }
.mprog { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--mc); }
.mcard { position: relative; }
.mcard.featured { grid-column: 1 / -1; background: linear-gradient(135deg, #fff7e6, #fff); border-top-width: 6px; }
.fbadge { position: absolute; top: 10px; right: 12px; background: var(--mc); color: #fff; font-size: 11px; font-weight: 800; padding: 1px 9px; border-radius: 99px; }

/* 讲解课 */
.kcard .intro { font-size: 17px; font-weight: 600; background: #f4f1ff; border-radius: 14px; padding: 10px 12px; }
.lsec { margin: 18px 0 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.lsec:first-of-type { border-top: 0; }
.lh { font-size: 18px; margin-bottom: 4px; color: var(--mc); }
.eg, .tipbox { border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: 15px; }
.eg { background: #eefaf3; border-left: 5px solid #35b36d; }
.tipbox { background: #fff8e1; border-left: 5px solid #ffc83d; }
.fig { margin: 12px 0; text-align: center; }
.svgbox { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 8px; max-width: 420px; margin: 0 auto; }
.svgbox svg { display: block; width: 100%; height: auto; max-height: 300px; }
.fig figcaption { font-size: 13.5px; margin-top: 6px; text-align: left; }
.recap { background: #f4f1ff; border-radius: 14px; padding: 10px 14px; margin-top: 16px; }
.recap ul { margin: 6px 0 0; padding-left: 20px; }
.recap li { margin: 4px 0; }
.goalbox { background: #e9f4ff; border-left: 5px solid #2d9cdb; border-radius: 12px; padding: 10px 12px; margin: 8px 0 12px; }
.lgrid { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.lbtn { display: flex; align-items: center; gap: 8px; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 8px 10px; min-width: 0; }
.lbtn.done { border-color: var(--good); background: var(--good-bg); }
.lbtn .licon { font-size: 24px; }
.lbtn .ltext { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.lbtn small { color: var(--muted); font-size: 12px; }
.lockn { color: #b9770e; }
.scard.locked { opacity: .55; }

/* 分步详解 */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: st; }
.step { position: relative; padding: 8px 10px 8px 12px; margin: 8px 0; border-radius: 12px; background: #f6f5ff; border-left: 5px solid var(--brand); font-size: 15px; }
.step.calc { background: #fff6e8; border-left-color: #f39c12; }
.step.check { background: #eefaf3; border-left-color: #35b36d; }
.step .sk { display: block; font-size: 12.5px; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
.tag.tr { background: #e9f4ff; color: #1f78b4; }
.mk { margin-top: 8px; font-size: 14.5px; }
.mk b { display: block; font-size: 13px; }

/* 错题对比 */
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.cmp-col { border-radius: 12px; padding: 8px 10px; font-size: 14.5px; min-width: 0; }
.cmp-col.mine { background: var(--bad-bg); }
.cmp-col.right { background: var(--good-bg); }
.cmp-h { display: block; font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
.det { margin: 6px 0; }
.det summary { cursor: pointer; font-weight: 700; color: var(--mc); padding: 4px 0; }

/* 通用:表单 / 预格式文本 */
.ta, .inp { width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 16px; background: #fff; resize: vertical; }
.ta:focus, .inp:focus { outline: 0; border-color: var(--mc); }
.fld { display: block; margin: 8px 0; }
.fld > span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
.pre { white-space: pre-wrap; word-break: break-word; background: #f6f5ff; border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 15px; margin: 6px 0; }
.good { color: #0d6b45; }
.bad-prompt { background: #fff0f0; border-radius: 10px; padding: 8px 10px; font-size: 15px; }
.chk { list-style: none; padding: 0; margin: 6px 0; }
.chk li { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.chk li:last-child { border-bottom: 0; }
.sample { background: #eefaf3; }
.tipl { padding-left: 20px; margin: 4px 0; }
.tipl li { margin: 6px 0; }
.parentbox { background: #fff8e1; }
.parentbox h3 { color: #8a5a00; }

/* AI 小课堂:闯关地图与游戏 */
.path { display: grid; gap: 10px; margin-top: 10px; }
.node { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 10px 12px; box-shadow: var(--shadow); }
.node.done { border-color: var(--good); background: var(--good-bg); }
.node.locked { opacity: .55; }
.node .nno { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--mc); color: #fff; font-weight: 800; }
.node.locked .nno { background: #bbb; }
.node .nicon { font-size: 30px; }
.node .ntext { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.node .ntext small { font-size: 12px; }
.jcard { text-align: center; }
.jemoji { font-size: 64px; line-height: 1.1; margin-bottom: 6px; }
.jemoji.sm { font-size: 40px; margin: 0 8px 0 0; }
.jrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.jbtn { border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 12px 8px; font-weight: 800; font-size: 16px; box-shadow: 0 3px 0 var(--line); min-width: 0; }
.jbtn.yes { border-color: #7ed4a4; background: #f0fbf5; }
.jbtn.no { border-color: #f0a0a4; background: #fff5f5; }
.jbtn.correct { border-color: var(--good); background: var(--good-bg); }
.jbtn.wrong { border-color: var(--bad); background: var(--bad-bg); }
.jbtn:disabled { color: var(--ink); cursor: default; }
.aisay { display: flex; align-items: flex-start; }
.bubble { background: #eef3ff; border-radius: 4px 14px 14px 14px; padding: 8px 12px; margin-top: 4px; font-size: 16px; }
.nwsent { text-align: center; }
.nwtext { font-size: 22px; font-weight: 700; min-height: 34px; }
.nwtext.big { font-size: 24px; color: var(--mc); }
.blink { animation: blink 1s steps(2) infinite; color: var(--mc); }
@keyframes blink { 50% { opacity: 0; } }
.pbar { display: grid; grid-template-columns: 90px 1fr 42px; gap: 8px; align-items: center; margin: 6px 0; font-size: 15px; }
.pbar.mine .pw { font-weight: 800; color: var(--mc); }
.pbar .pt { height: 14px; background: var(--line); border-radius: 99px; overflow: hidden; }
.pbar .pt i { display: block; height: 100%; background: var(--mc); }
.pbar .pp { text-align: right; font-weight: 700; color: var(--muted); }
.pw { min-width: 0; overflow-wrap: anywhere; }

/* 机器人迷宫 */
.mgridbox { display: grid; grid-template-columns: repeat(var(--w), 1fr); gap: 3px; max-width: 340px; margin: 10px auto; background: #dfe6f3; padding: 4px; border-radius: 14px; }
.mc { aspect-ratio: 1; display: grid; place-items: center; background: #fff; border-radius: 8px; font-size: clamp(16px, 7vw, 28px); position: relative; }
.mc.wall { background: #c9b8a6; }
.mc.goal { background: #e5f8ef; }
.mc .rob { font-size: clamp(18px, 8vw, 30px); }
.mc .dir { position: absolute; right: 2px; bottom: 0; font-size: 12px; color: #e5484d; line-height: 1; }
.blks { display: flex; flex-wrap: wrap; gap: 6px; min-height: 44px; }
.blk { border: 0; border-radius: 12px; padding: 10px 12px; font-weight: 800; font-size: 14px; color: #fff; background: #2d9cdb; box-shadow: 0 3px 0 rgba(0,0,0,.18); min-height: 44px; }
.blk.left, .blk.right { background: #6c5ce7; }
.blk.ifwall { background: #e8590c; }
.blk.sm { padding: 6px 8px; font-size: 13px; min-height: 40px; }
.blk i { font-style: normal; opacity: .7; margin-right: 2px; }
.blk:disabled { opacity: .45; }
.blks.prog { background: #f6f5ff; border-radius: 12px; padding: 6px; }

/* 阿语乐园:阿文排版(从右往左) */
.ar { font-family: var(--ar-font); direction: rtl; unicode-bidi: isolate; display: inline-block; line-height: 1.7; font-weight: 400; }
.ar.huge { font-size: 40px; line-height: 1.8; }
.ar.big2 { font-size: 36px; }
.ar.bigletter { font-size: 96px; line-height: 1.5; }
.ar.optar { font-size: 28px; line-height: 1.6; }
.ar.inl { font-size: 22px; }
.ar.exar { font-size: 28px; }
.ar.nm { font-size: 24px; }
.ar.gl { font-size: 26px; margin: 0 2px; }
.ar.tl { font-size: 44px; line-height: 1.5; }
.ar.fl { font-size: 40px; line-height: 1.5; }
.arhero { text-align: center; background: linear-gradient(135deg, #fff7e6, #fff); }
.bigrow { text-align: center; margin: 6px 0; }
.ldet .nrow { text-align: center; margin: 4px 0 8px; }
.forms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.forms .form { text-align: center; background: #f6f5ff; border-radius: 12px; padding: 4px 2px; min-width: 0; }
.forms .form.dim { opacity: .55; }
.forms .form small { display: block; font-size: 12px; color: var(--muted); }
.forms.mini .fl { font-size: 28px; }
.exrow { display: flex; gap: 12px; align-items: center; }
.exemoji { font-size: 48px; }
.speak.ar-speak { margin-left: 4px; }
.lgrid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.ltile { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; min-width: 0; box-shadow: 0 2px 0 var(--line); }
.ltile small { font-size: 11px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ggrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gcard { position: relative; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: var(--shadow); min-width: 0; }
.gcard.done { border-color: var(--good); background: var(--good-bg); }
.gcard .gno { position: absolute; top: 6px; left: 8px; font-weight: 800; color: var(--mc); }
.gcard .grow { direction: rtl; display: flex; justify-content: center; flex-wrap: wrap; }
.opts4 .choice .ar { margin: 0 auto; }
.opts4 .choice { justify-content: flex-start; }
.stage small { font-size: 13px; }
.wtr { font-size: 18px; font-weight: 700; margin: 2px 0; }
.wemoji.big { font-size: 80px; }
.flip .ar.huge { margin: 4px 0; }
@media (min-width: 701px) {
  .mgrid { grid-template-columns: repeat(3, 1fr); }
  .tabs a { font-size: 14px; }
  .lgrid { grid-template-columns: repeat(4, 1fr); }
  .ggrid { grid-template-columns: repeat(4, 1fr); }
  .mod.ai, .mod.arabic { max-width: 760px; }
}
