/* AIScholar — unified question figure + explanation presentation.
   Palette: primary #1769AA · light #EAF2FA · text #253247 · muted #5B6778
            border #D9E1EA · correct #16803D · accent #D95D39 */

.qf-figure {
  margin: 12px 0;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #D9E1EA;
  border-radius: 12px;
  overflow: hidden;
}
.qf-figure > svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 560px;
  margin: 0 auto;
}
.qf-figure figcaption {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #5B6778;
  text-align: center;
}
/* legacy figures pasted directly into a passage (no wrapper) still behave */
.q-text > svg,
.q-explanation > svg,
.passage-box > svg,
[data-dict="on"] > svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 560px;
  margin: 12px auto;
  background: #ffffff;
  border: 1px solid #D9E1EA;
  border-radius: 12px;
  padding: 10px;
  box-sizing: border-box;
}

/* ── explanation layout ── */
.qf-steps {
  font-size: 14px;
  line-height: 1.75;
  color: #253247;
  margin: 4px 0 0;
}
.qf-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 10px 0;
}
.qf-step-no {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #EAF2FA;
  color: #1769AA;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.qf-step-body { flex: 1 1 auto; min-width: 0; }
.qf-formula {
  font-family: 'Cambria Math', Georgia, 'Times New Roman', serif;
  background: #EAF2FA;
  border-radius: 8px;
  padding: 2px 8px;
  color: #12548A;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
  margin: 2px 0;
}
.qf-answer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #E7F4EC;
  color: #16803D;
  border: 1px solid rgba(22, 128, 61, 0.25);
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 700;
  font-size: 13px;
  margin: 6px 0;
}
.qf-keypoint {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 3px solid #1769AA;
  background: #EAF2FA;
  border-radius: 0 10px 10px 0;
  font-size: 13px;
  color: #253247;
}
.qf-keypoint b { color: #1769AA; }

@media (max-width: 640px) {
  .qf-figure { margin: 10px 0; padding: 6px; border-radius: 10px; }
  .qf-figure > svg { max-width: 100%; }
  .q-text > svg,
  .q-explanation > svg,
  .passage-box > svg,
  [data-dict="on"] > svg { padding: 6px; margin: 10px auto; max-width: 100%; }
  .qf-steps { font-size: 13.5px; line-height: 1.7; }
  .qf-formula { font-size: 13px; padding: 2px 6px; }
}
