/* 数学互动馆 · 本站专用样式（公式排版、坐标图、表格） */

/* 打个比方 */
.analogy { background: #eef1f7; border-radius: 18px; padding: 16px 18px; margin-top: 15px; color: #3d4a63; }
.analogy h3 { font-size: 15px; margin: 0 0 6px; color: #2f4473; display: flex; gap: 7px; align-items: center; }
.analogy h3 i { font-style: normal; font-size: 12px; background: #dae1ee; border-radius: 8px; padding: 2px 7px; color: #2f4473; }
.analogy p { font-size: 14px; line-height: 1.9; margin: 0; }

/* 步骤条：解方程、推理过程 */
.steps { display: flex; flex-wrap: wrap; gap: 5px 4px; margin-top: 12px; font-size: 13.5px; line-height: 1.5; }
.steps span { padding: 4px 8px; border-radius: 8px; background: #eef0f4; color: #78808f; transition: background .2s, color .2s; }
.steps span.on { background: #dbe4f4; color: #2f5aa8; font-weight: 600; }
.steps span.done { background: #e7efe6; color: #43704f; }
.steps i { font-style: normal; color: #b4bac6; align-self: center; }

/* 分数：<span class="frac"><i>分子</i><i>分母</i></span> */
.frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;  /* 分数线对齐到小写字母中线，不受字体基线影响 */
  text-align: center;
  margin: 0 .12em;
  line-height: 1.12;
}
.frac > i {
  font-style: normal;
  padding: 0 .28em;
  font-size: .86em;
}
.frac > i:first-child { border-bottom: 1.2px solid currentColor; }

/* 根号：<span class="radical">√<span>被开方数</span></span> */
.radical > span {
  border-top: 1.2px solid currentColor;
  padding: 0 .18em 0 .1em;
  margin-left: -.06em;
}

/* 公式行：居中、可横向滚动，长式子在手机上不会撑破版面 */
.formula {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: var(--surface-2, #f1f3ee);
  border-radius: 12px;
  font-size: 18px;
  line-height: 2.05;
  text-align: center;
  overflow-x: auto;
  color: var(--ink, #273043);
}
.formula b { color: #2f5aa8; font-weight: 700; }
.formula em { font-style: italic; color: #9c5231; }
.formula .step { display: block; }
.formula .step + .step { margin-top: 2px; }
.formula .why {
  display: block;
  font-size: 14px;
  color: var(--muted, #6f7685);
  line-height: 1.5;
  margin-top: -2px;
}

/* 行内变量用斜体，和中文拉开距离 */
var, .v { font-style: italic; font-family: "Times New Roman", Georgia, serif; font-size: 1.06em; }

/* 坐标系文字不参与选中，拖动时不会误选 */
.ax-text { user-select: none; -webkit-user-select: none; }
svg .hit { fill: transparent; }
svg .pt { cursor: grab; }
svg .pt:focus { outline: none; }
svg .pt:focus-visible circle { stroke: #2f5aa8; stroke-width: 3; }

/* 数值表：步骤表、数据表 */
table.compare, table.steps {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin-top: 10px;
}
table.compare th, table.compare td, table.steps th, table.steps td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line, #e2e5dd);
  text-align: left;
  vertical-align: top;
}
table.compare th, table.steps th {
  font-size: 13.5px;
  color: var(--muted, #6f7685);
  font-weight: 600;
  white-space: nowrap;
}
table.compare td.n, table.steps td.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.steps tr.on td { background: #eef3fb; }

/* 练习区：题号导航 */
.quiz-nav { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.quiz-nav .dot {
  width: 26px; height: 26px; padding: 0;
  border-radius: 8px; border: 1px solid var(--line, #e2e5dd);
  background: #fff; color: var(--muted, #6f7685);
  font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.quiz-nav .dot.on { border-color: #2f5aa8; color: #2f5aa8; font-weight: 700; box-shadow: 0 0 0 2px #e4ebf8; }
.quiz-nav .dot.ok { background: #e7efe6; border-color: #a9c6a4; color: #3d6b38; }
.quiz-nav .dot.bad { background: #fbeeea; border-color: #e0b6a6; color: #a4422c; }

/* 难度徽章 */
.lv {
  display: inline-block; margin-left: 7px; padding: 2px 8px;
  border-radius: 9px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
}
.lv-base { background: #e7efe6; color: #3d6b38; }
.lv-mid { background: #e4ebf8; color: #2f5aa8; }
.lv-trap { background: #fbeae2; color: #a4492b; }

/* 自测结果 */
.quiz-result {
  margin-top: 14px; padding: 12px 14px;
  background: #eef1f7; border-radius: 13px;
}
.quiz-result h4 { margin: 0 0 5px; font-size: 15.5px; color: #2f4473; }
.quiz-result p { margin: 0; font-size: 14.5px; line-height: 1.75; color: #4a5568; }
.quiz-result .weak { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.quiz-result .weak span {
  background: #fff; border-radius: 8px; padding: 3px 9px;
  font-size: 13.5px; color: #a4492b;
}

/* 中考怎么考 */
.exam-card { background: #fdf6ec; border-radius: 18px; padding: 16px 18px; margin-top: 15px; color: #6b4f2a; }
.exam-card h3 { font-size: 15px; margin: 0 0 8px; color: #8a5a22; display: flex; gap: 7px; align-items: center; }
.exam-card h3 i { font-style: normal; font-size: 12px; background: #f3e2c7; border-radius: 8px; padding: 2px 7px; color: #8a5a22; white-space: nowrap; flex: none; }
.exam-card ul { margin: 0; padding-left: 18px; }
.exam-card li { font-size: 14.5px; line-height: 1.85; margin: 4px 0; }
.exam-card b { color: #8a5a22; }
.exam-card .q {
  margin-top: 10px; padding: 10px 12px; background: #fff;
  border-radius: 11px; font-size: 14.5px; line-height: 1.8; color: #5a4a35;
}
.exam-card .q b { color: #a4492b; }

/* 首页覆盖统计 */
.cover-sum { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 12px; }
.cover-sum span { font-size: 14px; border-radius: 10px; padding: 5px 10px; background: #eef1f7; }
#cover-table a { color: #2f5aa8; text-decoration: underline; text-underline-offset: 2px; }
#cover-table td:first-child { white-space: nowrap; color: var(--muted, #6f7685); }

/* 结论卡列表 */
.fact-list { margin: 8px 0 0; padding-left: 18px; }
.fact-list li { margin: 5px 0; line-height: 1.62; }
.fact-list b { color: #2f5aa8; }

/* 可点的步骤条 */
.steps span[role=button] { cursor: pointer; }
.steps span[role=button]:focus-visible { outline: 2px solid #2f5aa8; outline-offset: 2px; }

input[type=range] { width: 100%; }
.small-label output { font-variant-numeric: tabular-nums; }

/* 计算器式的大数字读数 */
.bignum {
  font-size: 23.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #2f5aa8;
}
.bignum small { font-size: 15px; font-weight: 500; color: var(--muted, #6f7685); margin-left: 2px; }

/* 判定条件清单：对/错用颜色区分 */
.cond-list { list-style: none; margin: 8px 0 0; padding: 0; }
.cond-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 8px;
  border-radius: 9px;
  line-height: 1.55;
  font-size: 15.5px;
}
.cond-list li.yes { background: #eaf4ec; }
.cond-list li.no { background: #fbeeea; }
.cond-list li i { font-style: normal; font-weight: 700; }
.cond-list li.yes i { color: #2f6a4a; }
.cond-list li.no i { color: #a4422c; }

/* 摆放小方块的网格（展开图、三视图） */
.cube-grid {
  display: grid;
  gap: 3px;
  justify-content: center;
  margin-top: 10px;
}
.cube-grid button {
  width: 30px; height: 30px;
  border: 1px solid var(--line, #e2e5dd);
  border-radius: 5px;
  background: #fff;
  padding: 0;
  cursor: pointer;
}
.cube-grid button[aria-pressed=true] { background: #9fb4d8; border-color: #6f8ab8; }

p.part-info { font-size: 15px; line-height: 1.62; color: var(--ink, #273043); margin: 8px 0 0; }


/* —— 数字、公式、图内文字统一用无衬线体（正文也已改为无衬线体，楷体在小字号下会显得发虚、和数字对不齐） —— */
.bignum, .stat strong, .frac, var, .v, .formula, .radical,
td.n, th, table.compare, table.steps,
input, output, select, textarea, button,
.quiz-nav .dot, .lv, .badge, .cover-sum,
svg text, svg tspan {
  font-family: var(--font-ui);
}
/* 想明白为什么 */
.derive-card { background: #eaf0f6; border-radius: 18px; padding: 16px 18px; margin-top: 15px; color: #39485b; }
.derive-card h3 { font-size: 15px; margin: 0 0 8px; color: #2f4a68; display: flex; gap: 7px; align-items: center; }
.derive-card h3 i { font-style: normal; font-size: 12px; background: #d5e1ee; border-radius: 8px; padding: 2px 7px; color: #2f4a68; white-space: nowrap; flex: none; }
.derive-card .derive-lead { font-size: 14.5px; line-height: 1.85; margin: 0 0 11px; color: #4c5e73; }
.derive-card ol { margin: 0; padding: 0; list-style: none; counter-reset: dv; }
.derive-card ol > li { position: relative; padding-left: 27px; margin: 0 0 10px; counter-increment: dv; }
.derive-card ol > li::before {
  content: counter(dv); position: absolute; left: 0; top: 0;
  width: 19px; height: 19px; border-radius: 50%; background: #fff;
  color: #2f4a68; font-size: 13px; line-height: 19px; text-align: center;
  font-family: var(--font-ui);
}
.derive-card ol > li h4 { font-size: 14.5px; font-weight: 650; margin: 0 0 3px; color: #2f4a68; }
.derive-card ol > li p { font-size: 14.5px; line-height: 1.85; margin: 0; color: #4c5e73; }
.derive-card b { color: #2f4a68; font-weight: 650; }
.derive-card .derive-end {
  margin: 12px 0 0; padding: 10px 12px; background: #fff;
  border-radius: 11px; font-size: 14.5px; line-height: 1.8; color: #39485b;
}
.derive-card .derive-end > b:first-child {
  color: #a4492b; margin-right: 5px;
}
@media (max-width: 640px) {
  .derive-card { padding: 14px 15px; }
  .derive-card ol > li { padding-left: 25px; }
}

/* 公式块即使写成 <span class="formula"> 也按块级显示，避免背景框和下面的说明行被拆开 */
span.formula { display: block; }
