:root{--paper:#f6f5ef;--surface:#fffefb;--ink:#243b34;--muted:#69756e;--forest:#173f35;--sage:#dfe8d9;--line:#e1e5dc;--accent:#bd6146;--blue:#477794;--purple:#8a709b;--red:#b75244;--radius:18px;font-family:"PingFang SC","Microsoft YaHei",system-ui,sans-serif;color:var(--ink);background:var(--paper);font-size:15px}*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button,a,input{touch-action:manipulation}button,a{ -webkit-tap-highlight-color:transparent}button{cursor:pointer}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #c98b4d;outline-offset:4px}a{color:inherit}button{border:0}button:disabled{opacity:.4;cursor:default}.shell{display:grid;grid-template-columns:236px minmax(0,1fr);min-height:100vh}.sidebar{background:var(--forest);color:#f6f5ee;padding:34px 22px 26px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.brand{text-decoration:none;display:flex;gap:11px;align-items:center;font-weight:600;font-size:21px;white-space:nowrap}.brand small{display:block;font-size:8px;letter-spacing:2px;margin-top:7px;font-weight:400;color:#b8c8b5}.brand-mark{font-size:39px;line-height:1;color:#cfddb8}.sidebar-caption{font-size:11px;letter-spacing:2px;color:#b8c8b5;margin:49px 10px 17px}.lesson-link{width:100%;display:flex;text-align:left;gap:13px;align-items:center;background:none;color:#cbdbd0;padding:17px 13px;border-radius:11px;margin-bottom:7px}.lesson-link:hover{background:#244d40}.lesson-link.active{background:#e4ebd9;color:var(--forest)}.lesson-link .num{font-family:Georgia,serif;font-size:21px;opacity:.65;min-width:27px}.lesson-link .num.n3{font-size:17px;letter-spacing:-.03em}.lesson-link strong{font-size:15px;font-weight:500;display:block}.lesson-link small{font-size:10px;display:block;margin-top:5px;opacity:.75}.lesson-link .complete{margin-left:auto;font-size:12px}.sidebar-bottom{margin-top:auto;padding:35px 10px 0}.sidebar-bottom p{font-family:Georgia,"Songti SC",serif;font-size:17px;line-height:1.9;color:#d2dec9;margin:15px 0 28px}.text-button{background:none;color:inherit;padding:3px 0;font-size:12px;text-align:left}.text-button:hover{text-decoration:underline}.sidebar-bottom .text-button{display:block;color:#c9d6ca;margin:12px 0}.small{font-size:11px;line-height:1.8;color:var(--muted)}.sidebar-bottom .small{color:#9fb6a9;margin-top:24px}main{min-width:0;padding:0 42px 24px;max-width:1600px;width:100%;margin:auto}.topbar{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:77px;border-bottom:1px solid var(--line);font-size:12px;color:var(--muted)}.quiet-button{background:transparent;border:1px solid var(--line);padding:9px 13px;border-radius:8px;color:var(--ink);font-size:12px}.quiet-button:hover{background:var(--sage)}.quiet-button span{margin-left:15px}.lesson-head{display:flex;justify-content:space-between;align-items:center;padding:33px 0 27px;gap:20px}.eyebrow{font-size:10px;letter-spacing:2px;text-transform:uppercase;color:var(--accent);font-weight:600}.lesson-head h1{font-family:Georgia,"Songti SC",serif;font-size:36px;letter-spacing:1px;line-height:1.3;margin:12px 0 12px;font-weight:500}.lesson-head p{font-size:13px;color:var(--muted);line-height:1.8;margin:0;max-width:660px}.lesson-ordinal{font:italic 85px/1 Georgia,serif;color:#dbe3d5;padding:0 12px}.stage-nav{display:flex;gap:28px;border-bottom:1px solid var(--line);margin-bottom:24px}.stage-nav button{background:none;color:var(--muted);padding:0 0 15px;font-size:13px;border-bottom:2px solid transparent;white-space:nowrap}.stage-nav button span{font:italic 14px Georgia,serif;margin-right:6px;opacity:.7}.stage-nav button.active{color:var(--forest);border-bottom-color:var(--forest);font-weight:600}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:23px;align-items:start}.diagram-panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;min-width:0}.board-header{display:flex;align-items:center;justify-content:space-between;padding:19px 21px 13px;font-size:12px;gap:12px}.board-header>div{display:flex;align-items:center;gap:8px}.live-dot{height:6px;width:6px;border-radius:50%;background:#5b8361}.board-header .text-button{color:var(--muted);font-size:11px}.board-wrap{background-image:radial-gradient(#dde4d7 .65px,transparent .65px);background-size:20px 20px;position:relative;margin:0 9px}#board{display:block;width:100%;height:370px;touch-action:none;user-select:none}.board-message{position:absolute;left:12px;right:12px;bottom:8px;font-size:11px;color:var(--red);background:#fffefbea;line-height:1.6;border-radius:5px}.board-message:empty{display:none}.measurements{display:flex;flex-wrap:wrap;gap:10px 23px;border-top:1px solid var(--line);padding:14px 21px;min-height:56px;font-size:12px}.measurement{min-width:60px}.measurement small{font-size:10px;color:var(--muted);display:block;margin-bottom:4px}.measurement b{font-weight:500;font-variant-numeric:tabular-nums}.measurement.callout b{color:var(--forest)}.measurements .observation{font-size:12px;color:var(--muted);align-self:center}.controls{border-top:1px solid var(--line);padding:16px 21px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}.control{display:flex;flex-direction:column;gap:8px;min-width:0}.control>span{font-size:11px;color:var(--muted)}.control output{float:right;color:var(--ink);font-variant-numeric:tabular-nums}.control input[type=range]{width:100%;accent-color:var(--forest);margin:3px 0;height:22px}.control-row{display:flex;flex-wrap:wrap;gap:7px;grid-column:1/-1}.pill{border:1px solid var(--line);border-radius:6px;background:transparent;padding:7px 10px;color:var(--muted);font-size:11px}.pill.selected{background:var(--sage);color:var(--forest);border-color:#c7d6bf}.check-label{display:flex;gap:7px;align-items:center;font-size:11px;line-height:1.7}.check-label input{accent-color:var(--forest)}.board-foot{display:flex;flex-wrap:wrap;gap:9px 16px;font-size:10px;line-height:1.7;padding:0 21px 17px;color:var(--muted)}.free-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--accent);margin-right:4px}.learning-panel{padding:22px;background:#ebece2;border-radius:var(--radius);min-width:0}.panel-label{font-size:10px;letter-spacing:1.5px;color:var(--muted);margin-bottom:12px}.learning-panel h2{font-family:Georgia,"Songti SC",serif;font-size:22px;font-weight:500;line-height:1.5;margin:0 0 12px}.learning-panel p{font-size:12px;line-height:1.95;margin:10px 0;color:#526058}.learning-panel .formula{background:#f8f8f0;padding:15px 10px;border-radius:9px;margin:16px 0;text-align:center;font:17px/1.8 Georgia,"Songti SC",serif;overflow-wrap:anywhere}.learning-panel .formula small{font:11px/1.8 system-ui;display:block;color:var(--muted);margin-top:7px}.primary{background:var(--forest);color:#fffdf4;padding:12px 15px;border-radius:8px;font-size:12px;line-height:1.4}.primary:hover{background:#295849}.wide{width:100%}.secondary{background:transparent;border:1px solid #c4d0bf;color:var(--forest);padding:10px 12px;border-radius:8px;font-size:12px}.button-row{display:flex;gap:8px;margin-top:17px;flex-wrap:wrap}.choice{display:flex;align-items:flex-start;gap:9px;background:#f8f8f1;border:1px solid #d9dfd3;padding:11px;border-radius:8px;margin:8px 0;font-size:12px;line-height:1.6;cursor:pointer}.choice:has(input:checked){border-color:#799176;background:#f1f5e9}.choice input{accent-color:var(--forest);margin-top:3px;flex:none}.feedback{font-size:12px;line-height:1.85;padding:11px;border-radius:8px;margin-top:12px;background:#f6efe0;color:#76572f}.feedback.correct{background:#dce9d5;color:#31562c}.hint{font-size:11px;line-height:1.85;margin-top:12px;padding-left:10px;border-left:2px solid #b6c7ac;color:#55634f}.step-count{font:italic 12px Georgia,serif;color:var(--muted);margin-bottom:9px}.proof-reason{font-size:11px;line-height:1.8;border-top:1px solid #d3daca;padding-top:12px;margin-top:14px;color:var(--muted)}.proof-dots{display:flex;gap:6px;margin:16px 0}.proof-dot{width:23px;height:4px;border-radius:2px;background:#cdd6c5;padding:0}.proof-dot.active{background:var(--forest)}.exercise-count{font-size:11px;color:var(--muted);margin-bottom:14px}.source-tip{font-size:10px;line-height:1.8;color:var(--muted);border-top:1px solid #d1d9ca;padding-top:13px;margin-top:18px}.lesson-footer{display:flex;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-top:20px;color:var(--muted);font-size:10px;line-height:1.8}dialog{border:1px solid var(--line);border-radius:18px;padding:27px;background:var(--surface);color:var(--ink);width:min(620px,calc(100% - 32px));max-height:85vh;box-shadow:0 30px 90px #173f352b}dialog::backdrop{background:#173f3570}.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:20px}dialog h2{font-size:22px;font-weight:500;margin:0}dialog h3{font-size:15px;margin-top:25px}dialog p,dialog li{font-size:13px;line-height:1.9}dialog textarea{width:100%;min-height:240px;border:1px solid var(--line);border-radius:8px;background:#fbfbf5;padding:13px;resize:vertical;color:var(--ink)}.saved-note{font-size:11px;color:var(--muted);margin-top:10px}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:var(--forest);color:#fff;padding:12px 20px;border-radius:9px;font-size:12px;z-index:100;max-width:85%;display:none}.frac{display:inline-flex;vertical-align:middle;flex-direction:column;text-align:center;line-height:1.2;margin:0 3px}.frac>span:first-child{border-bottom:1px solid currentColor;padding:0 3px 3px}.frac>span:last-child{padding-top:3px}.math{font-family:Georgia,serif}svg .edge{stroke:#657a6f;stroke-width:1.6;fill:none}svg .aux{stroke:#91a497;stroke-width:1.15;stroke-dasharray:5 5;fill:none}svg .main-line{stroke:#296c5b;stroke-width:2;fill:none}svg .accent-line{stroke:#bf6d50;stroke-width:2;fill:none}svg .circle-line{stroke:#6d8e70;stroke-width:1.6;fill:none}svg .original-circle{stroke:#c1cebc;stroke-width:1.2;fill:none}svg .point{fill:#344f43;stroke:#fffdf7;stroke-width:1.3}svg .draggable{fill:#bd6146}svg .point-secondary{fill:#477794}svg .point-tertiary{fill:#8a709b}svg .hit{fill:transparent;stroke:none;cursor:grab}svg text{font:italic 14px Georgia,serif;fill:#304b3f;paint-order:stroke;stroke:#fffefb;stroke-width:3px;stroke-linejoin:round}svg .area-one{fill:#6b917d;fill-opacity:.14;stroke:none}svg .area-two{fill:#cc9862;fill-opacity:.15;stroke:none}svg .area-three{fill:#6f91a3;fill-opacity:.13;stroke:none}svg .right-angle{stroke:#91a497;stroke-width:1;fill:none}svg .tag-label{font:11px system-ui;stroke-width:4px}svg .angle-highlight{stroke:#bf6d50;stroke-width:2.5;fill:none}@media(min-width:1500px){main{padding-left:60px;padding-right:60px}.workspace{grid-template-columns:minmax(0,1fr) 340px}#board{height:420px}}@media(max-width:1180px){.shell{grid-template-columns:205px minmax(0,1fr)}.sidebar{padding:28px 14px}.brand{font-size:18px}main{padding:0 25px 24px}.workspace{grid-template-columns:minmax(0,1fr) 280px;gap:16px}.learning-panel{padding:19px}.lesson-head h1{font-size:30px}.lesson-ordinal{font-size:65px}.controls{grid-template-columns:1fr}.control{gap:3px}}@media(max-width:940px){.shell{grid-template-columns:180px minmax(0,1fr)}.brand{font-size:16px}.brand-mark{font-size:30px}.brand small{font-size:7px;letter-spacing:1px}.workspace{grid-template-columns:1fr}.learning-panel{padding:25px}.controls{grid-template-columns:repeat(3,minmax(0,1fr))}.lesson-ordinal{display:none}}@media(max-width:620px){.shell{display:block}.sidebar{position:static;height:auto;padding:19px 18px 12px}.brand{font-size:21px}.brand small{font-size:8px;letter-spacing:1.6px}.brand-mark{font-size:35px}.sidebar-caption,.sidebar-bottom{display:none}#lesson-nav{display:flex;gap:7px;margin-top:21px;overflow-x:auto;padding-bottom:3px}.lesson-link{flex:0 0 auto;width:auto;gap:7px;padding:10px 12px;margin:0}.lesson-link .num{font-size:15px;min-width:auto}.lesson-link .num.n3{font-size:15px;letter-spacing:0}.lesson-link strong{font-size:12px}.lesson-link small{display:none}.lesson-link .complete{font-size:10px}main{padding:0 16px 23px}.topbar{min-height:61px;font-size:10px}.quiet-button{font-size:10px;padding:8px}.quiet-button span{margin-left:4px}.lesson-head{padding:26px 0 23px}.lesson-head h1{font-size:29px}.lesson-head p{font-size:12px}.eyebrow{font-size:9px}.stage-nav{gap:20px;margin-bottom:18px}.stage-nav button{font-size:12px}.stage-nav button span{font-size:11px;margin-right:3px}.workspace{gap:16px}.board-header{padding:16px 15px 8px;font-size:11px}.board-wrap{margin:0 3px}#board{height:320px}.controls{padding:13px 15px;grid-template-columns:1fr}.control{gap:4px}.control input[type=range]{height:26px}.measurements{padding:13px 15px;gap:12px 20px}.board-foot{padding:0 15px 14px}.learning-panel h2{font-size:23px}.learning-panel p,.choice{font-size:13px}.primary,.secondary{font-size:13px;min-height:42px}.pill{min-height:36px}.lesson-footer{font-size:9px}dialog{padding:20px}}@media(prefers-reduced-motion:no-preference){button{transition:background .15s,color .15s}.learning-panel{animation:appear .22s ease} @keyframes appear{from{opacity:.5;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}}

.mobile-shortcuts{display:none}@media(max-width:620px){.mobile-shortcuts{display:flex;flex-wrap:wrap;gap:17px;margin-top:20px}}

@media(min-width:621px){.sidebar-caption{margin-top:28px;margin-bottom:12px;flex-shrink:0}#lesson-nav{overflow-y:auto;min-height:0;scrollbar-width:thin;scrollbar-color:#6f8e7f transparent}.lesson-link{padding-top:13px;padding-bottom:13px}.sidebar-bottom{padding-top:12px;flex-shrink:0}.sidebar-bottom p{font-size:15px;margin:8px 0 16px}.sidebar-bottom .small{margin-top:15px}}

svg .central-area{fill:#779d76;fill-opacity:.38;stroke:#537953;stroke-width:1.5}

svg .construction-square{fill:#9dbba5;fill-opacity:.11;stroke:#9bb09f;stroke-width:1}svg .construction-triangle{fill:#b3be91;fill-opacity:.12;stroke:#a0b294;stroke-width:1}svg .construction-flipped{fill:#c47b61;fill-opacity:.17;stroke:#bd6146;stroke-width:1.3;stroke-dasharray:4 3}svg .proof-source{stroke:#477794;stroke-width:3;fill:none}

svg .signed-negative{stroke:var(--purple);stroke-width:3;fill:none}

svg .soddy-inner{stroke:var(--accent);stroke-width:2;fill:#bd61460b}svg .soddy-outer{stroke:var(--blue);stroke-width:1.6;fill:none;stroke-dasharray:6 4}

.soddy-detail{flex-basis:100%;min-width:0;border-top:1px solid var(--line);padding-top:10px}.soddy-detail small{color:var(--muted);font-size:11px}.soddy-detail svg{display:block;width:100%;height:72px;max-width:420px}.soddy-detail p{font-size:12px;line-height:1.7;margin:8px 0 0}

svg .lune-shade{fill:#cc9862;fill-opacity:.32;stroke:none}

svg .temple-square{fill:none;stroke:#718d7a;stroke-width:1.3}svg .temple-square-active{fill:#6f91a3;fill-opacity:.07;stroke:#477794;stroke-width:1.6}

svg .fold-original{fill:#d7c5a1;fill-opacity:.12;stroke:none}svg .fold-image{fill:#4f8fac;fill-opacity:.1;stroke:none}svg .fold-piece{stroke:#ba6e39;stroke-width:4;stroke-linecap:round}
svg .tb-arrow{fill:#bf6d50;stroke:none}
/* 第141课 lattice_polygon_segments：网格、刻度与平行于坐标轴的边 */
.lps-grid{stroke:#dde4da;stroke-width:.8;fill:none}
svg text.lps-tick{font:11px system-ui,sans-serif;fill:#8a9a8e;stroke:none}
.lps-axis-edge{stroke:#b5483a;stroke-width:3;stroke-dasharray:6 4;fill:none}
/* 第142课 lines_meeting_count：直线按平行类着色；单数类用虚线，选中直线加粗（不只靠颜色区分） */
svg .lmn-c0{stroke:#2e6b5a;stroke-width:1.6;fill:none}
svg .lmn-c1{stroke:#b8603f;stroke-width:1.6;fill:none;stroke-dasharray:8 4}
svg .lmn-c2{stroke:#3f6f9a;stroke-width:1.6;fill:none}
svg .lmn-c3{stroke:#85609a;stroke-width:1.6;fill:none;stroke-dasharray:8 4}
svg .lmn-c4{stroke:#9a7a1f;stroke-width:1.6;fill:none}
svg .lmn-c5{stroke:#4f8a32;stroke-width:1.6;fill:none;stroke-dasharray:8 4}
svg .lmn-c6{stroke:#a3456a;stroke-width:1.6;fill:none}
svg .lmn-c7{stroke:#4a6878;stroke-width:1.6;fill:none;stroke-dasharray:8 4}
svg .lmn-sel{stroke-width:4.2;stroke-dasharray:none;stroke-linecap:round}
/* 第143课 red_blue_game：红点圆形、蓝点方形；空心圈为未染的获胜点；本课画板允许竖向滚动页面 */
#board.rbg-pan{touch-action:pan-y pinch-zoom}svg .rbg-lat{fill:#cdd6c8}svg .rbg-red{fill:#b75244;stroke:#fffdf7;stroke-width:1.3}svg .rbg-blue{fill:#477794;stroke:#fffdf7;stroke-width:1}svg .rbg-win{fill:none;stroke:#b75244;stroke-width:1.7}svg .rbg-blk{fill:none;stroke:#b75244;stroke-width:1;stroke-dasharray:2 2}svg .rbg-last{fill:none;stroke:#477794;stroke-width:1.3}
svg .mci-red{fill:#b75244;stroke:#fffdf7;stroke-width:1.3}
svg .mci-blue{fill:#477794;stroke:#fffdf7;stroke-width:1.2}
svg .mci-yellow{fill:#d9a521;stroke:#5f4a10;stroke-width:1}
svg .mci-none{fill:#fffefb;stroke:#657a6f;stroke-width:1.5}
svg .mci-fill-red{fill:#b75244;fill-opacity:.16;stroke:none}
svg .mci-fill-blue{fill:#477794;fill-opacity:.15;stroke:none}
svg .mci-fill-yellow{fill:#d9a521;fill-opacity:.22;stroke:none}
svg .mci-hit{fill:transparent;stroke:none;cursor:pointer}

.stc-gap{fill:#d0703c;fill-opacity:.55;stroke:#b4582a;stroke-width:.8}
/* 第149课 six_circle_chain：∠A、∠B、∠C 内的圆分色；⊙O₇ 与另一外切圆用虚线 */
svg .scc-ca{stroke:#296c5b;stroke-width:1.8;fill:none}svg .scc-cb{stroke:#477794;stroke-width:1.8;fill:none}svg .scc-cc{stroke:#bf6d50;stroke-width:1.8;fill:none}svg .scc-o7{stroke:#8a709b;stroke-width:2.2;fill:none;stroke-dasharray:7 5}svg .scc-alt{stroke:#bf6d50;stroke-width:1.4;fill:none;stroke-dasharray:6 4}

/* English edition (dist/en/): Latin-first font stack; scoped so the Chinese pages are unchanged */
:root[lang="en"]{font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}:root[lang="en"] .brand{font-size:18px}:root[lang="en"] .sidebar-caption{letter-spacing:1px}#lang-switch{margin-left:8px;text-decoration:underline}
