/* 数学实景实验：独立场景，不套用旧实验台外框。 */
#demo.math-field { padding:0; overflow:hidden; border:1px solid #d8ded3; border-radius:20px; box-shadow:0 16px 48px #263b2512; }
.math-field { --mf-ink:#203f35; --mf-accent:#286b53; --mf-paper:#f8f8ef; color:#263d32; background:var(--mf-paper); }
.math-field * { box-sizing:border-box; }
.math-field:not([data-level="0"]) .mf-caption { display:none; }
.math-field:not([data-level="0"]) .mf-stage-note { display:none; }
.math-field[data-level="3"] .mf-results,.math-field[data-level="4"] .mf-results { background:#284c48; }
.math-field[data-level="6"] .mf-results,.math-field[data-level="7"] .mf-results { background:#32424d; }
.math-field:not([data-level="0"]) .mf-main strong { font-size:29px; line-height:1.45; }
.mf-reading b { overflow-wrap:anywhere; min-width:0; }
.mf-header { padding:25px 28px 22px; display:flex; gap:20px; justify-content:space-between; align-items:center; }
.mf-kicker { font-size:10px; letter-spacing:2px; color:#6e8372; font-weight:700; margin-bottom:8px; }
.mf-header h3 { font-size:25px; letter-spacing:-.7px; color:var(--mf-ink); margin:0; }
.mf-header p { font-size:13px; color:#6a7d6c; margin:7px 0 0; line-height:1.7; }
.mf-tag { font-size:10px; color:#577962; border:1px solid #cedccc; border-radius:30px; white-space:nowrap; padding:7px 11px; }
.mf-grid { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(220px,1fr); border-block:1px solid #dce1d4; }
.mf-stage { min-width:0; background:#e7dbc4; position:relative; display:grid; }
.mf-caption { display:flex; justify-content:space-between; gap:12px; padding:14px 17px; position:absolute; top:0; left:0; right:0; z-index:1; pointer-events:none; }
.mf-caption span { padding:5px 8px; border-radius:5px; background:#fff9e8db; border:1px solid #eaddbd; color:#7c7259; font-size:10px; }
.mf-stage canvas { display:block; width:100%; height:100%; min-height:420px; background:transparent; border:0; border-radius:0; margin:0; }
.mf-stage canvas:focus-visible { outline:3px solid #508c71; outline-offset:-4px; }
.mf-stage-note { position:absolute; bottom:12px; left:17px; right:17px; font-size:10px; color:#7c7059; text-align:center; pointer-events:none; }
.mf-panel { padding:21px; background:#fafbf5; border-left:1px solid #dde2d4; min-width:0; }
.mf-panel h4 { color:#677e68; font-size:11px; margin:0 0 17px; letter-spacing:.8px; }
.mf-controls { display:grid; gap:14px; }
.mf-controls label { display:block; font-size:11px; color:#6b7d6a; min-width:0; }
.mf-controls output { float:right; font-size:12px; font-weight:650; color:#2a5742; font-variant-numeric:tabular-nums; }
.mf-controls input[type=range] { width:100%; appearance:none; height:5px; border-radius:5px; background:linear-gradient(to right,#3e8064 var(--mf-fill),#dce4d2 var(--mf-fill)); margin:12px 0 3px; cursor:pointer; }
.mf-controls input[type=range]::-webkit-slider-thumb { appearance:none; width:15px; height:15px; border:3px solid #3e8064; background:#fafbf5; border-radius:50%; }
.mf-controls input[type=range]::-moz-range-thumb { width:10px; height:10px; border:3px solid #3e8064; background:#fafbf5; border-radius:50%; }
.mf-controls select { display:block; margin-top:8px; width:100%; min-width:0; border:1px solid #d2dccb; border-radius:7px; background:#f1f5eb; color:#35533d; padding:8px; font:inherit; }
.math-field button { font:inherit; cursor:pointer; }
.math-field :is(button,input,select,summary):focus-visible { outline:3px solid #529074; outline-offset:3px; }
.mf-presets { display:flex; flex-wrap:wrap; gap:6px; margin:20px 0 15px; }
.mf-presets button { padding:6px 8px; font-size:10px; border:1px solid #d5dfcc; background:#eef3e7; color:#6a7c61; border-radius:6px; }
.mf-presets button:hover,.mf-presets button[aria-pressed=true] { background:#dfebd8; border-color:#9ebb9c; color:#285a40; }
.mf-action { display:flex; align-items:center; justify-content:center; width:100%; gap:9px; padding:11px; border:0; border-radius:9px; background:#264f3d; color:#f4f8e9; font-size:12px; }
.mf-action:hover { background:#32735a; }
.mf-action:disabled { opacity:.7; cursor:wait; }
.mf-action svg { width:16px; height:16px; }
.mf-panel-note { color:#8a937f; font-size:10px; line-height:1.7; margin:11px 0 0; }
.mf-results { padding:23px 28px; background:#193e31; color:#eaf1df; display:grid; grid-template-columns:1.2fr 1fr; gap:24px; }
.mf-main small { display:block; color:#b0c5aa; font-size:11px; }
.mf-main strong { display:block; font-size:36px; font-weight:650; letter-spacing:-1px; margin:7px 0; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.mf-main strong em { font-style:normal; font-size:13px; font-weight:400; color:#b5c4a9; margin-left:7px; letter-spacing:0; }
.mf-main p { font-size:11px; color:#bed0b7; line-height:1.8; margin:0; }
.mf-side { border-left:1px solid #ffffff16; padding-left:24px; display:flex; flex-direction:column; gap:14px; justify-content:center; }
.mf-reading { display:flex; justify-content:space-between; align-items:center; gap:12px; font-size:11px; color:#b1c6ab; }
.mf-reading b { color:#e1ecce; font-size:16px; font-weight:550; font-variant-numeric:tabular-nums; }
.mf-steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); padding:22px 16px; }
.mf-step { padding:0 12px; border-right:1px solid #dce1d2; }
.mf-step:last-child { border:0; }
.mf-step small { color:#83927d; font-size:10px; }
.mf-step b { display:block; color:#37553b; font-size:14px; font-weight:600; margin:8px 0 5px; overflow-wrap:anywhere; }
.mf-step p { color:#7a8673; font-size:11px; line-height:1.7; margin:0; }
.mf-question { margin:0 28px 20px; border:1px solid #d8e2cf; background:#eef4e6; border-radius:10px; padding:15px; }
.mf-question h4 { font-size:12px; color:#49654a; margin:0 0 10px; }
.mf-answers { display:flex; flex-wrap:wrap; gap:7px; }
.mf-answers button { padding:7px 10px; border:1px solid #ccd9c3; border-radius:6px; color:#56764d; background:#f9fbf4; font-size:11px; }
.mf-answers button[aria-pressed=true] { background:#d5e5c8; border-color:#91ab7e; }
.mf-feedback { color:#516d46; font-size:11px; line-height:1.8; margin-top:10px; min-height:20px; }
.mf-tools { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:9px; padding:0 28px 16px; }
.mf-tools span { color:#85907d; font-size:10px; }
.mf-tools button { background:transparent; border:1px solid #ccd8c4; color:#5d7457; border-radius:7px; padding:7px 10px; font-size:11px; }
.mf-records { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:0 28px 18px; }
.mf-record { padding:12px; background:#fffdf5; border:1px solid #dbe0d0; border-radius:8px; min-width:0; }
.mf-record img { width:100%; border-radius:5px; margin-bottom:6px; }
.mf-record b,.mf-record span { display:block; font-size:11px; color:#44683f; line-height:1.7; }
.mf-record span { font-size:10px; color:#89927b; overflow-wrap:anywhere; }
.mf-analysis { border-top:1px solid #dce2d2; padding:15px 28px; }
.mf-analysis>summary { font-size:11px; color:#7b896f; cursor:pointer; }
.mf-original { padding-top:20px; color:var(--text); --c:#3b5bdb; }
.mf-original .demo-controls { grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); }
.mf-original .table { display:block; max-width:100%; overflow-x:auto; }
.mf-original .demo-controls label { min-width:0; }
.mf-original .demo-controls input[type=range] { max-width:100%; }
.mf-boundary { font-size:10px; color:#8a917e; line-height:1.8; padding:0 28px 20px; margin:0; }
.mf-status { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
[data-theme=dark] #demo.math-field { border-color:#57624b; }
@media(max-width:700px) {
 .mf-header { padding:20px; }
 .mf-header h3 { font-size:22px; }
 .mf-tag { display:none; }
 .mf-grid { grid-template-columns:1fr; }
 .mf-panel { border-left:0; border-top:1px solid #dce1d4; padding:19px; }
 .mf-controls { grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px 17px; }
 .mf-stage canvas { height:370px; min-height:370px; }
 .mf-results { padding:20px; gap:15px; }
 .mf-main strong { font-size:29px; }
 .mf-side { padding-left:15px; }
 .mf-reading { flex-direction:column; align-items:flex-start; gap:4px; }
 .mf-question { margin:0 19px 18px; }
 .mf-tools { padding:0 19px 16px; }
 .mf-records { margin:0 19px 18px; }
 .mf-analysis { padding:15px 19px; }
 .mf-boundary { padding:0 19px 18px; }
}
@media(max-width:420px) {
 .mf-steps { grid-template-columns:1fr; gap:15px; padding:20px; }
 .mf-step { border:0; padding:0; display:grid; grid-template-columns:90px 1fr; }
 .mf-step b { margin:0; font-size:13px; }
 .mf-step p { grid-column:2; margin-top:5px; }
 .mf-records { grid-template-columns:1fr; }
 .mf-original .demo-controls { grid-template-columns:1fr; }
}
@media(prefers-reduced-motion:reduce) { .math-field * { scroll-behavior:auto!important; transition:none!important; } }
