/* ============================================================
   MathLingua · 桌面端练习界面
   左教具舞台 + 右题目 / 选项，底部多邻国风格反馈底盘
   ============================================================ */

#screen-practice { overflow: hidden; padding: 0; }

/* ============================ 练习顶栏 ============================ */
.practice-top {
  flex: none;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 26px;
  background: var(--white);
  border-bottom: 2px solid var(--line);
}
.practice-top .back-btn { flex: none; }

.practice-crumb {
  display: flex; align-items: center; gap: 11px;
  min-width: 0; flex: 1;
}
.crumb-emoji {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  font-size: 21px; line-height: 1;
  background: var(--green-soft);
  border-radius: 13px;
  box-shadow: 0 3px 0 #d3f2b2;
}
.crumb-text { min-width: 0; }
.crumb-text b {
  display: block; font-size: 16px; font-weight: 900;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crumb-text small {
  display: block; font-size: 11.5px; font-weight: 800;
  color: var(--text-muted); margin-top: 1px;
}

.practice-score {
  display: flex; align-items: center; gap: 8px; flex: none;
}
.ps {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: var(--radius-pill);
  background: #f5f5f5;
  font-size: 13px; font-weight: 900; color: var(--text-soft);
  white-space: nowrap;
}
.ps b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.ps small { font-size: 11px; font-weight: 800; color: var(--text-muted); }
.ps.ok { background: var(--green-soft); color: var(--green-deep); }
.ps.ok b { color: var(--green-deep); }
.ps.combo {
  background: #fff4e5; color: var(--orange-deep);
  transition: transform 0.2s cubic-bezier(0.2, 1.5, 0.4, 1), background 0.2s ease;
}
.ps.combo.hot { background: #ffe3b8; transform: scale(1.05); }

/* ============================ 主体 ============================ */
.practice-scroll {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 22px 26px 28px;
  display: flex; flex-direction: column;
}
.practice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 20px;
  align-items: stretch;
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}

.stage-panel,
.quiz-panel {
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 0 var(--line);
  padding: 20px;
  min-width: 0;
}
.stage-panel {
  display: flex; flex-direction: column;
}
.quiz-panel {
  display: flex; flex-direction: column; gap: 14px;
  background: #fdfdfd;
  border-color: #eeeeee;
}

.quiz-actions { margin-top: auto; }

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.panel-head h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 900; color: var(--text);
}
.panel-head h2 span { font-size: 19px; }
.panel-tools { display: flex; gap: 8px; flex-wrap: wrap; }

/* 教具舞台 */
.visual-stage {
  position: relative;
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: 250px;
  padding: 22px 20px;
  border-radius: var(--radius-lg);
  border: 2px dashed #dceaf4;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.9), transparent 46%),
    linear-gradient(160deg, #fbfdff, #f2f9ff 70%, #fdfbff);
  overflow: hidden;
}
.visual-stage.tall { min-height: 380px; }

.visual-caption {
  min-height: 24px;
  margin-top: 12px;
  text-align: center;
  font-size: 13.5px; font-weight: 800; color: var(--blue-deep);
  line-height: 1.5;
}
.visual-caption:empty::before {
  content: "点「🎬 教具动画演示」，一步一步讲清算理";
  color: var(--text-muted); font-weight: 700;
}

/* 题目卡 */
.q-card {
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: 0 3px 0 var(--line);
}
.q-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.q-tag {
  background: var(--green-soft); color: var(--green-deep);
  font-size: 11.5px; font-weight: 900;
  padding: 4px 11px; border-radius: var(--radius-pill);
}
.q-count {
  font-size: 11.5px; font-weight: 800; color: var(--text-muted);
}
.q-prompt {
  font-size: 16.5px; line-height: 1.7; font-weight: 800; color: var(--text);
}
.q-formula {
  margin-top: 14px;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  background: #f8fbff;
  border: 2px solid #eaf3fb;
  font-size: 38px; font-weight: 900; letter-spacing: 3px;
  color: #2f2f2f; text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  word-break: break-word;
}
.q-formula sup { font-size: 18px; }

/* ============================ 选项 ============================ */
.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.option {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: var(--white);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: var(--radius-md);
  padding: 15px 16px;
  font: inherit; font-size: 19px; font-weight: 800; color: var(--text);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease,
    border-color 0.15s ease, box-shadow 0.1s ease;
  font-variant-numeric: tabular-nums;
}
.option:hover:not(:disabled) { background: #f8f8f8; border-color: var(--line-strong); }
.option:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; }
.option:focus-visible { outline: 3px solid rgba(28, 176, 246, 0.5); outline-offset: 2px; }

.option .opt-key {
  flex: none;
  width: 30px; height: 30px; border-radius: 10px;
  border: 2px solid var(--line);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 900; color: var(--text-muted);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.option .opt-label { flex: 1; min-width: 0; }

.option.selected {
  border-color: #84d8ff; background: var(--blue-soft); color: var(--blue-deep);
}
.option.selected .opt-key { border-color: #84d8ff; color: var(--blue-deep); }
.option.correct {
  border-color: var(--green); background: var(--green-soft); color: var(--green-deep);
}
.option.correct .opt-key { border-color: var(--green); color: var(--green-deep); }
.option.wrong {
  border-color: var(--red); background: var(--red-soft); color: var(--red-deep);
}
.option.wrong .opt-key { border-color: var(--red); color: var(--red-deep); }
.option.dim { opacity: 0.42; }
.option:disabled { cursor: default; }

/* ============================ 操作区 ============================ */
.quiz-actions { display: flex; gap: 12px; }
.quiz-actions #btn-random { flex: 0 0 40%; }
.quiz-actions #btn-check { flex: 1; }

.quiz-tip {
  text-align: center;
  font-size: 11.5px; font-weight: 700; color: var(--text-muted);
  line-height: 1.5;
}

/* ============================ 反馈底盘 ============================ */
.feedback {
  flex: none;
  position: relative;
  z-index: 45;
  max-height: 0;
  overflow: hidden;
  background: var(--white);
  border-top: 0 solid transparent;
  transition: max-height 0.34s cubic-bezier(0.2, 0.9, 0.3, 1),
    border-color 0.2s ease;
  pointer-events: none;
}
.feedback.show {
  max-height: min(62vh, 420px);
  overflow-y: auto;
  border-top-width: 2px;
  box-shadow: 0 -10px 26px rgba(0, 0, 0, 0.07);
  pointer-events: auto;
}
.feedback.ok { background: #ecffdb; border-top-color: #bce996; }
.feedback.bad { background: #ffecec; border-top-color: #ffc2c2; }
.feedback.neutral { background: #e8f7ff; border-top-color: #b6e3fb; }

.feedback-inner {
  display: flex; align-items: flex-start; gap: 18px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 26px 20px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.25s ease 0.05s, transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1) 0.05s;
}
.feedback.show .feedback-inner { opacity: 1; transform: none; }

.fb-icon {
  flex: none;
  width: 54px; height: 54px; border-radius: 18px;
  display: grid; place-items: center;
  font-size: 28px; line-height: 1;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.06);
  animation: fbPop 0.42s cubic-bezier(0.2, 1.5, 0.4, 1);
}
@keyframes fbPop {
  0% { transform: scale(0.4) rotate(-16deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.fb-body { flex: 1; min-width: 0; }
.fb-body h3 { font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.feedback.ok .fb-body h3 { color: var(--green-deep); }
.feedback.bad .fb-body h3 { color: var(--red-deep); }
.feedback.neutral .fb-body h3 { color: var(--blue-deep); }
.fb-body p {
  font-size: 13.5px; font-weight: 800; color: #575757; line-height: 1.55;
}

.fb-answer {
  display: inline-block;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 15px; font-weight: 900; color: var(--text);
}
.fb-answer b { color: var(--green-deep); }

.fb-steps {
  list-style: none;
  margin: 10px 0 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 7px;
}
.fb-steps li {
  display: flex; gap: 8px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 13px; font-weight: 800; color: #4f5b4a;
  line-height: 1.5;
}
.fb-steps li::before { content: "💡"; flex: none; font-size: 13px; }

.fb-actions {
  flex: none;
  display: flex; flex-direction: column; gap: 10px;
  align-self: center;
  min-width: 170px;
}

/* ============================ 响应式 ============================ */
@media (max-width: 1180px) {
  .practice-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr); }
  .q-formula { font-size: 32px; letter-spacing: 2px; }
  .visual-stage { min-height: 260px; }
}

@media (max-width: 980px) {
  .practice-top { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .practice-crumb { order: -1; flex: 1 1 100%; }
  .practice-score { flex: 1; }
  .practice-scroll { padding: 16px 16px 24px; }
  .practice-grid { grid-template-columns: 1fr; gap: 16px; }
  .visual-stage { min-height: 260px; }
  .feedback-inner { flex-wrap: wrap; gap: 12px; padding: 16px 18px 18px; }
  .fb-actions { flex-direction: row; width: 100%; min-width: 0; }
  .fb-actions .btn-3d { flex: 1; }
}

@media (max-width: 640px) {
  .practice-top { padding: 10px 12px; gap: 8px; }
  .crumb-emoji { width: 36px; height: 36px; font-size: 18px; border-radius: 11px; }
  .crumb-text b { font-size: 14.5px; }
  .practice-score { gap: 6px; }
  .ps { padding: 6px 9px; font-size: 12px; }
  .ps b { font-size: 13px; }
  .ps small { display: none; }
  .practice-scroll { padding: 12px 12px 20px; }
  .stage-panel, .quiz-panel { padding: 14px; border-radius: var(--radius-lg); }
  .visual-stage { min-height: 220px; padding: 16px 10px; }
  .panel-head { margin-bottom: 10px; }
  .panel-head h2 { font-size: 14.5px; }
  .panel-tools .btn-3d { padding: 7px 11px; font-size: 12.5px; }
  .q-card { padding: 14px; }
  .q-prompt { font-size: 15px; }
  .q-formula { font-size: 28px; letter-spacing: 1.5px; padding: 10px 6px; }
  .options { grid-template-columns: 1fr; gap: 10px; }
  .option { padding: 13px 14px; font-size: 17px; }
  .quiz-actions #btn-random { flex: 0 0 42%; }
  .quiz-actions .btn-3d { padding: 13px 12px; font-size: 15px; border-radius: 15px; }
  .quiz-tip { display: none; }
  .fb-icon { width: 44px; height: 44px; font-size: 22px; border-radius: 14px; }
  .fb-body h3 { font-size: 17px; }
  .fb-steps { grid-template-columns: 1fr; }
}
