/* 速算挑战专属样式（公共组件、变量见 ../../style.css）
   复用护眼童趣主题：暖色底、降饱和柔和配色、大圆角 */

#app {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
  width: 100%;
  max-width: 760px;
}

#sidebar {
  background: var(--panel);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.actions { display: flex; flex-direction: column; gap: 8px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-row .btn { padding: 10px 8px; }

/* 进度圆点 */
.progress-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); transition: background .15s; }
.dot.current { background: var(--primary); opacity: 0.45; }
.dot.done { background: var(--primary); }

/* 已辅助时最佳栏灰显 */
.stat-value.muted { color: var(--primary); opacity: 0.4; }

/* 主区 */
#play-area {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 24px;
  padding: 32px 24px;
  min-height: 380px;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

/* 玩法区：题面居中 */
.play-zone {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

/* 题面表达式 */
.expr {
  font-size: 38px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.expr-token { display: inline-block; }
.expr-token.op { color: var(--primary); font-weight: 700; }
.expr-token.num { min-width: 1.2em; text-align: center; }
.expr-token.blank {
  min-width: 1.4em;
  text-align: center;
  border-bottom: 3px solid var(--primary);
  color: var(--primary);
}
.expr-token.blank.placeholder { opacity: 0.5; }
.expr-token.blank.revealed { color: #43a047; border-color: #43a047; }

/* 答案输入显示 */
.answer-input {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  min-height: 1.4em;
  min-width: 80px;
  text-align: center;
  padding: 4px 16px;
  border-bottom: 2px solid var(--border);
  font-variant-numeric: tabular-nums;
  transition: color .15s, border-color .15s;
}
.answer-input.wrong { color: #e53935; border-color: #e53935; }
.answer-input.solved { color: #43a047; border-color: #43a047; }

/* 数字键盘 */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
  width: 100%;
}
.key {
  height: 60px;
  font-size: 24px;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: background .12s, transform .08s;
  touch-action: manipulation;
}
@media (hover: hover) {
  .key:hover:not(:disabled) { background: #efe6cf; }
}
.key:active:not(:disabled) { transform: translateY(1px); }
.key:disabled { opacity: 0.4; cursor: not-allowed; }
.key-clear { color: #e57373; }
.key-back { color: #7a6f5c; }

/* 确认按钮 */
.submit-btn {
  font-size: 18px;
  font-weight: 700;
  padding: 14px;
  max-width: 320px;
  margin: 0 auto;
  width: 100%;
}

/* 胜利弹窗记录行 */
.modal-content .win-record { color: var(--primary); font-size: 15px; min-height: 1.2em; }

/* 响应式 */
@media (max-width: 640px) {
  #app { grid-template-columns: 1fr; }
  #play-area { padding: 22px 16px; min-height: 300px; }
  .expr { font-size: 30px; }
  .answer-input { font-size: 26px; }
  .key { height: 54px; font-size: 22px; }
  .submit-btn { font-size: 16px; padding: 12px; }
}
