/* 幼儿数数页 /tool/fruit-math。
   沿用工具页的仪器感：细线、等宽数字、单一皇家蓝。
   与旧版不同：整块游戏（工具条、数量、式子、实物、按钮、题目、选项、盖章）
   只占一张 canvas，坐标命中与所有文字都由 tool-math.js 绘制，
   所以这里只留画布容器、视觉隐藏的播报层、页头与说明区排版。
   兼容 PC、平板与移动端横版；矮屏另有收紧规则，不再为手机竖屏单独排版。 */

/* ---------------------------------------------------------------- 页头 */
.fm-hero{padding:56px 0 36px;border-bottom:1px solid var(--rule)}
.fm-title{font-size:clamp(40px,6vw,72px);line-height:1.2;letter-spacing:-.055em;margin-bottom:20px}
.fm-title span{color:var(--accent)}
.fm-lede{font-size:16px;line-height:1.95;color:var(--ink-2);max-width:34em}
.fm-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;margin-top:26px;
  font-family:var(--mono);font-size:11.5px;color:var(--ink-3);letter-spacing:.04em}
.fm-meta-dot{width:3px;height:3px;border-radius:50%;background:var(--rule-2)}

/* ---------------------------------------------------------------- 画布 */
.fm-stage{padding:28px 0 56px;background:var(--bg-2);border-bottom:1px solid var(--rule)}
.fm-panel{position:relative;max-width:1040px;margin:0 auto;background:var(--bg);
  border:1px solid var(--rule);border-radius:2px;overflow:hidden}
.fm-canvas{display:block;width:100%;height:520px;outline:none;touch-action:manipulation}
.fm-canvas[hidden]{display:none}
.fm-fallback{padding:36px 24px;font-size:14px;line-height:1.9;color:var(--ink-2)}

/* 视觉隐藏：状态播报只给读屏与键盘，不占画面 */
.fm-a11y{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;
  clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}

/* ---------------------------------------------------------------- 说明 */
.fm-notes{padding:56px 0 40px}
.fm-method{display:grid;grid-template-columns:1fr 1fr;gap:44px;padding-top:6px}
.fm-col h3{font-size:16px;margin-bottom:12px;letter-spacing:-.02em}
.fm-col h3 + p{margin-top:0}
.fm-col p{font-size:13.5px;line-height:1.95;color:var(--ink-2);margin-bottom:13px}
.fm-col b{color:var(--ink)}
.fm-formula{font-family:var(--mono);font-size:11.5px;line-height:1.95;background:var(--bg-2);
  border-left:2px solid var(--rule-2);padding:12px 14px;color:var(--ink-2);
  white-space:pre-wrap;word-break:break-word}

.fm-bounds{padding:0 0 56px}
.fm-disclaimer{margin-top:22px;padding-top:22px;border-top:1px solid var(--rule)}
.fm-disclaimer p{font-size:12.5px;line-height:1.95;color:var(--ink-3);max-width:64em;margin-bottom:10px}
.fm-disclaimer b{color:var(--ink-2)}
.fm-noscript{padding:36px 0;font-size:14px;line-height:1.9;color:var(--ink-2)}

/* ---------------------------------------------------------------- 平板 */
@media(max-width:820px){
  .fm-hero{padding:40px 0 28px}
  .fm-stage{padding:20px 0 40px}
  .fm-method{grid-template-columns:1fr;gap:26px}
  .fm-notes{padding:40px 0 32px}
  .fm-bounds{padding-bottom:40px}
}

/* ---------------------------------------------------------------- 中等高度视口
   平板横屏（1024×768）与矮一点的笔记本窗口：页头收紧但保留导语，
   把高度让给画布，避免画布被压到 300 px 以下。 */
@media(max-height:820px){
  .nav-inner{height:48px}
  .fm-hero{padding:24px 0 18px}
  .fm-title{font-size:clamp(34px,5vw,52px);margin-bottom:10px}
  .fm-lede{font-size:14px;line-height:1.6;max-width:none}
  .fm-meta{margin-top:12px;font-size:10.5px}
  .fm-stage{padding:14px 0 30px}
}

/* ---------------------------------------------------------------- 横版矮屏
   手机横屏（约 844×390 / 667×375）里，页头与导航都要让位给画布：
   标题收小、导语隐藏，画布由脚本按视口剩余高度自适应，两个大按钮仍在首屏。 */
@media(max-height:560px){
  .nav-inner{height:44px}
  .fm-hero{padding:8px 0 10px}
  .fm-hero .hero-eyebrow{display:none}
  .fm-title{font-size:26px;line-height:1.15;margin-bottom:4px}
  .fm-lede{display:none}
  .fm-meta{margin-top:6px;font-size:10px;gap:6px 10px}
  .fm-stage{padding:6px 0 20px}
  .fm-notes{padding-top:30px}
}

/* 画布里的动画由脚本读同一偏好整体跳过，CSS 侧不再有 DOM 动画可关。 */
@media(prefers-reduced-motion:reduce){
  .fm-panel{transition:none}
}
