:root{--ff-navy:#12384b;--ff-teal:#007d82;--ff-cream:#f7f7f2}body{font-family:system-ui,'Noto Sans CJK SC','Microsoft YaHei',sans-serif}.bd-article-container{max-width:1080px!important}h1,h2,h3{color:var(--ff-navy)}.reader-toolbar{position:sticky;top:0;z-index:10;background:#fff;border:1px solid #ccd9dc;border-radius:12px;padding:12px;display:flex;gap:8px;flex-wrap:wrap;box-shadow:0 3px 12px #12384b15}.reader-toolbar button,.ff-widget button{background:#12384b;color:white;border:0;border-radius:7px;padding:8px 12px;cursor:pointer}.reader-toolbar output{padding:8px}.source-line{border-left:3px solid #dbe4e6;padding:8px 14px;margin:8px 0;border-radius:4px;position:relative;cursor:pointer;transition:background .15s}.source-line p:last-child{margin-bottom:0}.source-line::before{content:attr(data-line);font-size:11px;color:#657b83;display:block;font-family:monospace}.source-line.is-active{background:#fff3d6;outline:2px solid #cc9b3c}.source-line.is-active::before{font-weight:700;color:#614500}.source-line.definition{border-left-color:#168b71;background:#effaf5}.source-line.theorem{border-left-color:#3076bd;background:#eff6ff}.source-line.proposition{border-left-color:#8665b5;background:#f7f0ff}.source-line.lemma{border-left-color:#c27b1d;background:#fff7ea}.source-line.corollary{border-left-color:#478ba3;background:#f0f9fb}.admonition.definition{border-color:#168b71}.admonition.theorem{border-color:#3076bd}.admonition.proposition{border-color:#8665b5}.admonition.lemma{border-color:#c27b1d}.admonition.reading-note{border-color:#007d82;background:#f4faf9}.source-line details{margin-top:10px}.source-line summary{color:#006d72;font-size:14px}.reader-note{font-size:14px;color:#335b60;background:#f4faf9;padding:12px;margin-top:8px}.reader-original{margin-top:20px;background:#f5f6f8;padding:12px;border-radius:8px}.reader-original img{max-width:100%;height:auto}.hide-notes .reading-note,.hide-notes .reader-note{display:none}.ff-widget{background:#f1f7f7;border:1px solid #b9d2d4;border-radius:12px;padding:18px;margin:18px 0}.ff-widget label{display:inline-block;margin:6px 12px 6px 0}.ff-widget input,.ff-widget select{padding:7px;border:1px solid #b4c8ce;border-radius:5px;max-width:150px}.ff-widget pre{white-space:pre-wrap;background:white;margin-top:15px;padding:15px}.quiz-feedback{margin:8px;font-weight:600}.lecture-meta{color:#657b83;font-size:.85rem}.local-note{width:100%;min-height:65px;margin:10px 0}.reader-progress{font-size:13px}.bd-content .admonition-title{font-weight:700}@media print{.reader-toolbar,.ff-widget button,.local-note{display:none}}@media(prefers-color-scheme:dark){html[data-theme=dark] .source-line,html[data-theme=dark] .ff-widget,html[data-theme=dark] .reading-note{color:#142e37}html[data-theme=dark] .reader-toolbar{background:#202a30}html[data-theme=dark] h1,html[data-theme=dark] h2,html[data-theme=dark] h3{color:#83ced1}}

/* A complete mathematical statement has one frame; its paragraphs remain navigable. */
.statement-box {
  border: 1px solid #ccd9dc;
  border-left-width: 4px;
  border-radius: 8px;
  padding: 12px 18px;
  margin: 18px 0;
  background: #f7f9fa;
}
.statement-box.definition {
  border-color: #168b71;
  background: #effaf5;
}
.statement-box.theorem {
  border-color: #3076bd;
  background: #eff6ff;
}
.statement-box.proposition {
  border-color: #8665b5;
  background: #f7f0ff;
}
.statement-box.lemma {
  border-color: #c27b1d;
  background: #fff7ea;
}
.statement-box.corollary {
  border-color: #478ba3;
  background: #f0f9fb;
}
.statement-box.example {
  border-color: #6c8994;
  background: #f5f8fa;
}
.statement-box.notation {
  border-color: #007d82;
  background: #f4faf9;
}
.statement-box.exercise {
  border-color: #c27b1d;
  background: #fff7ea;
}
.statement-box .source-line {
  border: 0;
  margin: 0;
  padding: 6px 0;
  background: transparent;
}
.statement-box .source-line::before,
.source-line.source-heading::before {
  display: none;
}
.statement-box .source-label {
  font-weight: 700;
  color: var(--ff-navy);
}
.statement-box .source-line.is-active {
  outline: none;
  background: #fff3d6;
}
.source-line.source-heading {
  border: 0;
  padding: 0;
  margin: 16px 0;
  font-weight: 700;
  background: transparent;
  outline: none;
}
html[data-theme=dark] .statement-box {
  color: #142e37;
}

/* Use solid black bullets for the numbered remarks in Chapter 1. */
.admonition.reading-note[id^="c01-remark-"] > ul,
.statement-box .admonition.chapter-remark > ul {
  list-style-type: disc;
  padding-inline-start: 1.4em;
  margin-bottom: 0;
}
.admonition.reading-note[id^="c01-remark-"] > ul > li::marker,
.statement-box .admonition.chapter-remark > ul > li::marker {
  color: #000;
}
.admonition.reading-note[id^="c01-remark-"] > ul > li + li,
.statement-box .admonition.chapter-remark > ul > li + li {
  margin-top: 0.55rem;
}

/* Textbook reading, keyboard focus, and narrow screens. */
.bd-article { line-height: 1.85; }
.source-line:focus-visible, .reader-toolbar button:focus-visible,
.quiz button:focus-visible, .ff-widget button:focus-visible {
  outline: 3px solid #007d82; outline-offset: 3px;
}
.quiz { border: 1px solid #b9d2d4; border-radius: 8px; padding: 16px; margin: 20px 0; }
.quiz button { padding: 7px 16px; border: 1px solid #6c8994; border-radius: 6px; cursor: pointer; }
.local-note { padding: 10px; border: 1px solid #b4c8ce; border-radius: 6px; }
.reader-original summary { cursor: pointer; }
html[data-theme=dark] .reader-original { background: #202a30; color: #e0e8ed; }
html[data-theme=dark] .reader-toolbar output { color: #e0e8ed; }
html[data-theme=dark] .statement-box a,
html[data-theme=dark] .statement-box .source-label { color: #12384b; }
@media (max-width: 600px) {
  .statement-box { padding: 10px 12px; }
  .reader-toolbar { padding: 8px; gap: 6px; }
  .reader-toolbar button { padding: 7px 9px; }
  .ff-widget { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .source-line { transition: none; } }
/* Theme choice can differ from the operating system's color scheme. */
html[data-theme=dark] .reader-toolbar { background: #202a30; }
html[data-theme=dark] .admonition.reading-note,
html[data-theme=dark] .ff-widget { color: #142e37; }
html[data-theme=dark] .source-line { color: inherit; }
html[data-theme=dark] .source-line.is-active { color: #142e37; }
.reader-toolbar { top: calc(var(--pst-header-height, 4rem) + .5rem); }
/* Override the theme's Bootstrap container spacing for mathematical frames. */
.bd-article .statement-box { padding: 12px 18px; }
@media (max-width: 600px) { .bd-article .statement-box { padding: 10px 12px; } }
/* The square animation stays readable in either theme and at phone widths. */
.square-symmetry { padding: 20px; margin: 24px 0; border: 1px solid #b9d2d4; border-radius: 14px; background: var(--pst-color-surface, #f5f8fa); }
.symmetry-workspace { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(230px, 1fr); gap: 20px; align-items: start; }
.square-symmetry svg { display: block; width: 100%; max-width: 340px; margin: 0 auto; }
.symmetry-background { fill: #f8fafb; stroke: #d3dee2; }
.symmetry-ghost { fill: none; stroke: #a0adb5; stroke-width: 2; stroke-dasharray: 5 5; }
.symmetry-axis { stroke: #71838f; stroke-width: 1.5; stroke-dasharray: 4 5; }
.symmetry-axis-label { fill: #536772; font-size: 12px; }
.symmetry-center { fill: #71838f; }
.symmetry-polygon { fill: #c4e9e966; stroke: #007d82; stroke-width: 3; stroke-linejoin: round; }
.symmetry-vertex { fill: white; font: 700 16px system-ui, sans-serif; pointer-events: none; }
.square-symmetry h4 { font-size: 1rem; margin: 0 0 10px; }
.square-symmetry h5 { text-align: center; margin: 0 0 8px; }
.symmetry-controls h4:not(:first-child) { margin-top: 20px; }
.symmetry-actions, .symmetry-relations { display: flex; flex-wrap: wrap; gap: 8px; }
.symmetry-elements { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.square-symmetry button { padding: 8px 12px; background: #12384b; color: white; border: 2px solid transparent; border-radius: 7px; cursor: pointer; font: inherit; line-height: 1.4; }
.square-symmetry button:focus-visible { outline: 3px solid #007d82; outline-offset: 3px; }
.square-symmetry button[aria-pressed=true] { background: #007d82; border-color: #12384b; box-shadow: 0 0 0 2px #9cd6d6; }
.square-symmetry button:disabled { opacity: .55; cursor: wait; }
.symmetry-state, .symmetry-sr-state, .symmetry-rs-state, .symmetry-history { font-size: .88rem; margin: 12px 0 0; }
.symmetry-state { min-height: 5em; }
.symmetry-comparison { border-top: 1px solid #b9d2d4; margin-top: 18px; padding-top: 18px; }
.symmetry-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 18px 0; }
.symmetry-caption { font-size: .83rem; color: var(--pst-color-text-muted, #536772); margin-bottom: 0; }
@media (max-width: 700px) {
 .square-symmetry { padding: 12px; }
 .symmetry-workspace { grid-template-columns: 1fr; }
 .symmetry-pair { grid-template-columns: 1fr; }
 .symmetry-state { min-height: 0; }
}
@media print { .square-symmetry button { display: none; } }
/* Leave room for the sticky reader controls when opening the animation link. */
#square-symmetry, .square-symmetry { scroll-margin-top: 12rem; }
.lesson-widget { border: 1px solid #b9d2d4; border-radius: 12px; padding: 18px; margin: 20px 0; background: var(--pst-color-surface,#f5f8fa); }
.lesson-controls { display:flex; flex-wrap:wrap; align-items:end; gap:12px; }
.lesson-controls label { display:flex; flex-direction:column; gap:4px; font-size:.9rem; }
.lesson-controls input, .lesson-controls select { padding:7px; border:1px solid #b4c8ce; border-radius:6px; max-width:100%; }
.lesson-controls input[type=number] { width:100px; }
.lesson-controls input[type=text] { width:180px; }
.lesson-controls button { color:#fff; background:#12384b; padding:8px 12px; border:0; border-radius:6px; cursor:pointer; }
.lesson-result { white-space:pre-wrap; overflow-wrap:anywhere; font: .92rem/1.8 system-ui,'Microsoft YaHei',sans-serif; padding:14px; margin:16px 0; background:var(--pst-color-background,#fff); border-radius:6px; }
.lesson-error { color:#b43b32; }
.lesson-visual { overflow-x:auto; max-height:430px; }
.lesson-table { border-collapse:collapse; width:100%; font-size:.88rem; }
.lesson-table th,.lesson-table td { border:1px solid #b9d2d4; padding:7px 10px; }
.lesson-table thead { position:sticky; top:0; background:var(--pst-color-background,#fff); z-index:1; }
.lesson-caption { color:var(--pst-color-text-muted,#536772); font-size:.83rem; margin:12px 0 0; }
.lesson-zero { background:#fff0dd; color:#704316; }
.lesson-nonzero { background:#e7f7f0; color:#155d43; }
.lesson-controls :focus-visible { outline:3px solid #007d82; outline-offset:2px; }
@media(max-width:600px) { .lesson-widget { padding:12px; } .lesson-controls { gap:8px; } .lesson-controls label { max-width:100%; } }
@media print { .lesson-controls { display:none; } .lesson-visual { max-height:none; } }
/* Keep concept navigation and experiment links below sticky reader controls. */
.bd-article section, .lesson-widget { scroll-margin-top: 12rem; }

/* Interactive Hasse diagram of the finite-field subfield lattice. */
.subfield-visual { max-height:none; overflow-x:auto; }
.subfield-diagram { display:block; width:100%; min-width:340px; max-width:700px; margin:0 auto; }
.subfield-edge { stroke:#9aaeb8; stroke-width:2; fill:none; }
.subfield-edge.is-related { stroke:#007d82; stroke-width:3; }
.subfield-arrowhead { fill:#567d8c; }
.subfield-node { cursor:pointer; }
.subfield-node rect { fill:var(--pst-color-background,#fff); stroke:#899eaa; stroke-width:1.5; }
.subfield-node text { fill:var(--pst-color-text-base,#233845); pointer-events:none; font-family:system-ui,'Microsoft YaHei',sans-serif; }
.subfield-label { font-size:22px; font-weight:600; }
.subfield-degree { font-size:12px; }
.subfield-node.is-contained rect { fill:#e7f7f0; stroke:#278065; }
.subfield-node.is-containing rect { fill:#e8f1fc; stroke:#387cae; }
.subfield-node.is-contained text,.subfield-node.is-containing text { fill:#193945; }
.subfield-node.is-selected rect { fill:#007d82; stroke:#005c61; stroke-width:3; }
.subfield-node.is-selected text { fill:white; }
.subfield-node:focus-visible { outline:none; }
.subfield-node:focus-visible rect { stroke:#e99412; stroke-width:4; }
.subfield-detail { padding:12px 14px; margin-top:14px; background:var(--pst-color-background,#fff); border:1px solid #b9d2d4; border-radius:8px; font-size:.9rem; }
.subfield-detail p { margin:0 0 6px; }
.subfield-detail p:last-child { margin:0; }
.subfield-legend { font-size:.83rem; color:var(--pst-color-text-muted,#536772); margin:12px 0 0; }
html[data-theme=dark] .subfield-edge { stroke:#93aab6; }
html[data-theme=dark] .subfield-edge.is-related { stroke:#69c9c8; }
@media print { .subfield-diagram { min-width:0; } }

/* Independent textbook headings and learning notes. */
.statement-title { font-weight:700; color:var(--ff-navy); margin-bottom:8px; }
.chapter-note { min-height:180px; padding:12px; font:inherit; }
.export-notes { padding:8px 14px; background:#12384b; color:white; border:0; border-radius:6px; cursor:pointer; }
.export-notes:focus-visible { outline:3px solid #007d82; outline-offset:3px; }
.chapter-goals { margin:18px 0; }
html[data-theme=dark] .chapter-note { background:#202a30; color:#e0e8ed; }
/* Dark admonitions must not inherit the dark ink of a light statement frame. */
html[data-theme=dark] .admonition:not(.reading-note) {
  color: var(--pst-color-text-base, #e0e8ed);
}
html[data-theme=dark] .admonition:not(.reading-note) a {
  color: var(--pst-color-link, #83ced1);
}
html[data-theme=dark] .admonition:not(.reading-note) .source-label,
html[data-theme=dark] .admonition:not(.reading-note) .statement-title {
  color: inherit;
}
/* Legacy calculators have their own light surfaces; switch ink and surface together. */
html[data-theme=dark] .ff-widget {
  color: var(--pst-color-text-base, #e0e8ed);
  background: var(--pst-color-surface, #202a30);
}
html[data-theme=dark] .ff-widget pre,
html[data-theme=dark] .ff-widget input,
html[data-theme=dark] .ff-widget select {
  color: var(--pst-color-text-base, #e0e8ed);
  background: var(--pst-color-background, #121212);
}
html[data-theme=dark] .lesson-error { color: #ffada3; }
.bd-article input::placeholder,
.bd-article textarea::placeholder {
  color: var(--pst-color-text-muted, #64748b);
  opacity: 1;
}
@media print { .export-notes,.chapter-note { display:none; } }
.ff-sidebar-close { display:none; }
dialog[open] .ff-sidebar-close {
  display:block;align-self:flex-end;margin:8px 12px;padding:10px 12px;
  min-height:44px;border:1px solid var(--pst-color-border,#ccd9dc);border-radius:6px;
  color:var(--pst-color-text-base,#12384b);background:var(--pst-color-background,#fff);
  font:inherit;cursor:pointer;
}
.sidebar-toggle:focus-visible,.ff-sidebar-close:focus-visible { outline:3px solid #d48d22;outline-offset:2px; }

/* A single mathematical frame as a classroom slide. */
.ff-present-button { display:block;flex-shrink:0;margin:0 0 0 auto;padding:5px 10px;min-height:36px;border:1px solid #6c8994;border-radius:6px;background:#fff;color:#12384b;font:500 13px/1.4 system-ui,'Microsoft YaHei',sans-serif;cursor:pointer; }
.ff-frame-heading { display:flex;align-items:center;gap:12px; }
.ff-frame-heading > p { margin:0; }
.admonition.toggle > .ff-frame-heading { padding-right:3rem; }
.admonition > .ff-frame-heading .toggle-button:before { display:none; }
.ff-presentation-toolbar button:disabled { opacity:.5;cursor:default; }
.ff-presentation { width:96vw;max-width:1500px;height:94dvh;max-height:96dvh;padding:0;border:1px solid var(--pst-color-border,#ccd9dc);border-radius:12px;background:var(--pst-color-background,#fff);color:var(--pst-color-text-base,#12384b); }
.ff-presentation[open] { display:flex;flex-direction:column; }
.ff-presentation::backdrop { background:rgb(0 0 0 / 72%); }
.ff-presentation.ff-browser-fullscreen { width:100vw;max-width:none;height:100dvh;max-height:none;border:0;border-radius:0; }
.ff-presentation-toolbar { display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:12px 18px;border-bottom:1px solid var(--pst-color-border,#ccd9dc);font-size:14px; }
.ff-presentation-heading { margin-right:auto; }
.ff-presentation-toolbar label { display:flex;align-items:center;gap:6px;margin:0; }
.ff-presentation-toolbar button { min-height:44px;padding:8px 12px;border:1px solid var(--pst-color-border,#ccd9dc);border-radius:6px;background:var(--pst-color-surface,#f5f8fa);color:inherit;font:inherit;cursor:pointer; }
.ff-presentation-size { width:110px; }
.ff-presentation-status:empty { display:none; }
.ff-presentation-body { flex:1;min-height:0;display:flex; }
.ff-presentation-scroll {
  flex:1;min-height:0;overflow-x:hidden;overflow-y:auto;
  padding:clamp(12px,2vw,28px);display:block;scrollbar-width:none;
}
.ff-presentation-scroll::-webkit-scrollbar { display:none;width:0;height:0; }
.ff-presentation-scrollbar {
  flex:none;width:16px;margin:8px 8px 8px 0;border-radius:8px;
  background:#e6eef0;position:relative;touch-action:none;
}
.ff-presentation-scrollbar[hidden] { display:none; }
.ff-presentation-scrollbar-thumb {
  position:absolute;left:2px;right:2px;top:0;min-height:36px;
  border-radius:6px;background:#5d7c86;cursor:grab;
}
.ff-presentation-stage { min-height:100%;width:100%;display:flex;align-items:flex-start;justify-content:flex-start;overflow:visible; }
.ff-presentation-content { width:100%;max-width:100%;margin:0;font-size:var(--ff-presentation-size,26px);line-height:1.55;box-sizing:border-box; }
.ff-presentation-content .statement-box,.ff-presentation-content .admonition { font-size:inherit;margin:0;box-shadow:none;max-height:none; }
.ff-presentation-content .source-line { font-size:inherit;cursor:auto; }
.ff-presentation-content .source-line::before,.ff-presentation-content .ff-present-button { display:none; }
.ff-presentation-content .source-line.is-active { background:transparent;outline:0; }
.ff-presentation-content .admonition-title { font-size:inherit;font-weight:700; }
.ff-presentation-content .reading-note,.ff-presentation-content .chapter-remark { display:none!important; }
.ff-presentation-content > .reading-note,.ff-presentation-content > .chapter-remark,
.ff-presentation.ff-show-notes .reading-note,.ff-presentation.ff-show-notes .chapter-remark { display:block!important; }
.ff-presentation-content .reading-note,.ff-presentation-content .chapter-remark { margin-top:1em; }
.ff-presentation-content > .reading-note,.ff-presentation-content > .chapter-remark { margin-top:0; }
.ff-presentation-content .slide-section-title { font-size:1.35em;font-weight:700;text-align:center;margin:18vh 0; }
.ff-presentation-content .course-figure img { width:auto;max-width:100%;height:auto;object-fit:contain; }
.ff-presentation-content .math-display {
  overflow-x:auto;
  max-height:none;
  font-size:.88em;
  line-height:1.45;
}
.ff-presentation-content .math-display mjx-container,
.ff-presentation-content .math-display svg {
  max-width:100%;
  height:auto;
}
.ff-presentation-content ul,
.ff-presentation-content ol { margin:.35em 0 .35em 1.1em; padding:0; }
.ff-presentation-content li { margin:.2em 0; }
.ff-presentation-content p { margin:.35em 0; }
.ff-present-button:focus-visible,.ff-presentation :focus-visible { outline:3px solid #d48d22;outline-offset:3px; }

/* Reading view: each frame looks like a slide card */
.bd-article .slide-frame,
.bd-article .statement-box {
  margin: 1rem 0;
  break-inside: avoid;
}
/* Narrative prose: visible on the webpage, skipped by classroom presentation */
.bd-article .reading-note {
  margin: .85rem 0 1.1rem;
  padding: .15rem 0 .15rem .85rem;
  border-left: 3px solid #c5d5da;
  color: #3a4f57;
  line-height: 1.65;
}
.bd-article .reading-note > p:first-child { margin-top: .2rem; }
.bd-article .reading-note > p:last-child { margin-bottom: .2rem; }
html[data-theme=dark] .bd-article .reading-note {
  border-left-color: #4a6570;
  color: var(--pst-color-text-muted, #b9c6cc);
}
.bd-article .slide-section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: .2rem 0;
}
.bd-article h2, .bd-article h3 {
  margin: 1.4rem 0 .6rem;
}
a.xref { color: inherit; text-decoration: underline dotted; text-underline-offset: 2px; }
a.xref:hover { color: #0f5c6e; }
.bd-article .cite { color: #5a7179; font-size: .92em; white-space: nowrap; }
.bd-article .cite-key { cursor: help; border-bottom: 1px dotted #9aafb5; }
.ff-presentation-content .cite { font-size: .72em; opacity: .8; white-space: normal; }
blockquote.definition-quote {
  margin: .85rem 0;
  padding: .75rem 1rem;
  border-left: 4px solid #0f5c6e;
  background: #f3f8f9;
  font-style: normal;
}
blockquote.definition-quote p { margin: .35rem 0; }
.ff-presentation-content blockquote.definition-quote {
  background: #eef6f7;
}
.classroom-banner { border-left: 4px solid #0f5c6e; }
.classroom-banner .ff-present-start {
  display: inline-block;
  margin-top: .4rem;
  padding: .55rem 1rem;
  border: 0;
  border-radius: 8px;
  background: #0f5c6e;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.classroom-banner .ff-present-start:hover { filter: brightness(1.08); }
@media(max-width:600px) { .ff-presentation { width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0; } .ff-presentation-toolbar { padding:8px;gap:8px; } .ff-presentation-heading { flex-basis:100%; } .ff-present-button { min-height:44px; } }
@media print { .ff-present-button,.ff-presentation { display:none!important; } }

/* No extra spacing beside punctuation or inside/displayed mathematics. */
#c16-example-09-exp-table .pst-scrollable-table-container,
#c16-example-09-log-table .pst-scrollable-table-container { overflow-x:auto; max-width:100%; }
#c16-example-09-exp-table table,
#c16-example-09-log-table table { width:max-content; min-width:100%; white-space:nowrap; }
#c16-example-09-exp-table th:first-child,
#c16-example-09-exp-table td:first-child,
#c16-example-09-log-table th:first-child,
#c16-example-09-log-table td:first-child { position:sticky;left:0;z-index:1;background:#f5f8fa; }
:root { --ff-inline-math-gap: 0.18em; }
.bd-article .ff-math-gap-before { margin-left:var(--ff-inline-math-gap); }
.bd-article .ff-math-gap-after { margin-right:var(--ff-inline-math-gap); }
/* Inline math must stay on the text line. A block-level mjx-container
   turns "数量为 $t$" into a line break before and after every symbol. */
.bd-article span.math {
  display: inline-flex !important;
  max-width: none;
  overflow: visible;
  vertical-align: baseline;
}
.bd-article span.math > mjx-container:not([display="true"]) {
  display: inline-block !important;
  margin: 0 !important;
  vertical-align: -0.15em;
}

/* Student-filled numeric examples. Not a classroom slide. */
.mpc-play {
  margin: 16px 0 22px;
  padding: 14px 16px 16px;
  border: 1px solid #b7d0d4;
  border-radius: 12px;
  background: #f4fafb;
  color: #12384b;
}
.mpc-play h4 { margin: 0 0 6px; font-size: 1.05rem; color: #12384b; }
.mpc-play .mpc-lead { margin: 0 0 12px; color: #3d5560; }
.mpc-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin-bottom: 12px; }
.mpc-fields label { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; min-width: 5.5rem; }
.mpc-play input, .mpc-play select {
  font: inherit; color: inherit; background: #fff;
  border: 1px solid #9bb6bc; border-radius: 6px; padding: 6px 8px; min-height: 36px; width: 6.5rem;
}
.mpc-play button {
  background: #12384b; color: #fff; border: 0; border-radius: 7px;
  padding: 8px 12px; min-height: 36px; cursor: pointer; font: inherit;
}
.mpc-play button.secondary { background: #007d82; }
.mpc-play table { border-collapse: collapse; margin: 8px 0 12px; width: auto; max-width: 100%; }
.mpc-play th, .mpc-play td { border: 1px solid #d5e0e6; padding: 6px 10px; text-align: center; background: #fff; }
.mpc-play th { background: #e7f3f4; }
.mpc-play td.seen, .mpc-play th.seen { font-weight: 700; background: #fff6df; }
.mpc-play .mpc-out { margin: 0 0 8px; }
.mpc-play .mpc-warn { color: #8a3b12; }
.mpc-checks { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 4px 0 10px; }
.mpc-checks label { display: flex; align-items: center; gap: 6px; min-width: 0; }
html[data-theme=dark] .mpc-play { background: #1b282e; color: #e0e8ed; border-color: #3d555c; }
html[data-theme=dark] .mpc-play h4,
html[data-theme=dark] .mpc-play .mpc-lead { color: #e0e8ed; }
html[data-theme=dark] .mpc-play input,
html[data-theme=dark] .mpc-play select,
html[data-theme=dark] .mpc-play th,
html[data-theme=dark] .mpc-play td { background: #12191c; color: #e0e8ed; border-color: #3d555c; }
html[data-theme=dark] .mpc-play th { background: #24343a; }
html[data-theme=dark] .mpc-play td.seen,
html[data-theme=dark] .mpc-play th.seen { background: #3a3424; }
