/* 100 以内加减法 */
.math { min-height: 100vh; min-height: 100dvh; background: #FBF6EF; color: var(--ink); }
.math[hidden] { display: none; }
.math-head { display: flex; align-items: center; gap: 16px; padding: 20px 24px; }
.math-back { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--ink); text-decoration: none; font-size: 30px; }
.math-head h1 { margin: 0; font-size: 22px; }
.math-head p { margin: 2px 0 0; color: var(--ink-3); font-size: 13px; }
.math-progress { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.math-progress a, .math-stars { padding: 8px 10px; border-radius: 999px; background: #FFF4D6; color: #7A5A12; font-weight: 700; text-decoration: none; white-space: nowrap; }
.math-score { padding: 8px 16px; border-radius: 999px; background: #FFF4D6; color: #7A5A12; font-weight: 700; white-space: nowrap; }
.math-main { max-width: 680px; margin: 0 auto; padding: 24px 20px 60px; text-align: center; }
.math-modes { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.math button { font: inherit; cursor: pointer; }
.math-modes button { border: 0; border-radius: 999px; padding: 10px 24px; background: transparent; color: var(--ink-2); font-weight: 700; }
.math-modes button[aria-pressed="true"] { background: var(--clay); color: white; }
.math-card { margin-top: 24px; padding: clamp(24px, 6vw, 52px); border: 1px solid var(--line); border-radius: 28px; background: #fff; box-shadow: 0 10px 30px rgba(80,50,30,.08); }
.math-hint { margin: 0; color: var(--ink-2); font-size: 18px; }
.math-equation { margin: 28px 0; font-size: clamp(36px, 8vw, 68px); font-weight: 700; white-space: nowrap; }
.math-equation span { color: var(--clay-deep); }
.math-speak { padding: 9px 18px; margin: -8px 0 8px; border: 1px solid #D7B6A6; border-radius: 999px; background: #FFF9F2; color: var(--clay-deep); font-weight: 700 !important; }
.math-audio-status { margin: 0 0 12px; color: #B64C3B; font-size: 14px; }
.math-audio-status:empty { margin: 0; }
.math-form { max-width: 360px; margin: 0 auto; }
.math-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.math-keypad button { min-height: 58px; border: 2px solid var(--line); border-radius: 16px; background: #FBF6EF; color: var(--ink); font-size: 26px; font-weight: 700; }
.math-keypad [data-digit="0"] { grid-column: 2; }
.math-keypad .math-delete { color: var(--clay-deep); }
.math-confirm { width: 100%; margin-top: 12px; }
.math-primary { min-height: 58px; padding: 12px 24px; border: 0; border-radius: 16px; background: var(--clay-deep); color: #fff; font-weight: 700 !important; font-size: 18px !important; }
.math-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.math-options button { min-height: 86px; border: 2px solid var(--line); border-radius: 18px; background: #FBF6EF; color: var(--ink); font-size: 30px; font-weight: 700; }
.math-options button.wrong { border-color: #D2604B; color: #B64C3B; }
.math-options button.right { border-color: #4F9A5E; color: #367842; background: #EAF3EC; }
.math-feedback { min-height: 28px; margin: 20px 0 0; font-size: 18px; font-weight: 700; }
.math-feedback.wrong { color: #B64C3B; }
.math-feedback.right { color: #367842; }
.math-next { margin-top: 12px; }
.math button:focus-visible, .math input:focus-visible, .math-back:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
@media (max-width: 520px) {
  .math-head { padding: 16px; gap: 10px; }
  .math-score { padding: 8px 10px; font-size: 14px; }
  .math-options { grid-template-columns: repeat(2, 1fr); }
}
