.has-geometry-game:not(.is-compact) .lesson-dialog-header { min-height:480px; padding-right:60%; }
.has-geometry-game:not(.is-compact) .lesson-dialog-header h2 { font-size:clamp(2.2rem,4.3vw,4rem); }
.has-geometry-game .lesson-dialog-header { flex-shrink:0; }
.has-geometry-game .lesson-header-surface::after { right:44%; opacity:.25; }
.geometry-game { position:absolute; top:50px; left:43%; right:64px; color:#fff3d6; font-family:"SimHei","Microsoft YaHei",var(--sans); }
.geometry-game button { min-height:32px; padding:5px 9px; border:0; border-radius:4px; color:inherit; background:transparent; font:500 .65rem "SimHei","Microsoft YaHei",var(--sans); cursor:pointer; }
.geometry-game button:hover { background:#fff3d619; }
.geometry-game button:focus-visible { outline:1px solid currentColor; outline-offset:3px; }
.geometry-board { display:block; width:100%; height:auto; aspect-ratio:480 / 260; margin-top:6px; touch-action:none; overflow:hidden; }
.geometry-grid-line { fill:none; stroke:currentColor; stroke-opacity:.20; stroke-width:.7; }
.geometry-ghost { fill:none; stroke:currentColor; stroke-opacity:.25; stroke-dasharray:3 4; stroke-width:1; }
.geometry-game[data-tool="cut"] .geometry-board { cursor:crosshair; }
.puzzle-piece { outline:none; cursor:grab; }
.geometry-game[data-tool="cut"] .puzzle-piece { cursor:crosshair; }
.puzzle-piece:active { cursor:grabbing; }
.puzzle-piece polygon { fill:#fff3d6; fill-opacity:.28; stroke:currentColor; stroke-width:1.2; stroke-linejoin:round; }
.puzzle-color-1 polygon { fill-opacity:.35; }
.puzzle-color-2 polygon { fill-opacity:.48; }
.puzzle-color-3 polygon { fill-opacity:.2; }
.puzzle-piece.is-selected polygon { stroke-width:2; }
.puzzle-piece:focus-visible polygon { stroke-width:2.4; stroke-dasharray:3 2; }
.puzzle-scale { fill:currentColor; opacity:.55; font:10px KaTeX_Main,"Times New Roman",serif; pointer-events:none; }
.puzzle-scale path { fill:none; stroke:currentColor; stroke-width:.8; }
.puzzle-vertex { fill:currentColor; pointer-events:none; }
.puzzle-cut-preview { pointer-events:none; }
.puzzle-cut-preview line { stroke:#fffbe9; stroke-width:1.7; stroke-dasharray:4 3; }
.puzzle-cut-preview circle { fill:#fffbe9; stroke:#a96c24; stroke-width:1; }
.puzzle-right-angle { fill:none; stroke:currentColor; stroke-width:1; pointer-events:none; }
.puzzle-cut-angles .puzzle-right-angle { stroke:#fffbe9; stroke-width:1.3; }
.geometry-tools { display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap; margin-bottom:6px; }
.geometry-tools button { padding:5px 10px; background:#fff3d60d; }
.geometry-tools button[aria-pressed="true"] { background:#fff3d6; color:#80501a; }
.geometry-tools button:disabled { opacity:.3; cursor:default; }
.geometry-tools button:disabled:hover { background:#fff3d60d; }
.geometry-answer { display:flex; align-items:center; justify-content:center; gap:7px; margin-top:15px; font-size:.85rem; font-variant-numeric:tabular-nums; }
.geometry-area-symbol { white-space:nowrap; }
.geometry-area-symbol sub { font-size:.58em; }
.geometry-math-symbol { font-family:KaTeX_Math,"Times New Roman",serif; font-style:italic; font-weight:400; }
.geometry-math-unit { font-family:KaTeX_Main,"Times New Roman",serif; font-style:normal; font-weight:400; white-space:nowrap; }
.geometry-math-unit sup { font-size:.7em; }
.geometry-answer input { width:49px; min-width:0; height:34px; padding:4px; border:0; border-bottom:1px solid #fff3d699; border-radius:0; color:inherit; background:#fff3d60d; font:inherit; text-align:center; }
.geometry-operator { appearance:none; flex:0 0 32px; width:32px; min-width:0; height:34px; padding:2px 10px 2px 2px; border:0; border-bottom:1px solid #fff3d699; border-radius:0; color:inherit; background-color:#fff3d60d; background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%); background-position:right 6px center,right 3px center; background-size:3px 3px; background-repeat:no-repeat; font:inherit; font-family:KaTeX_Main,"Times New Roman",serif; text-align:center; cursor:pointer; }
.geometry-operator option { color:#493724; background:#fffaf2; }
.geometry-answer .geometry-divisor { width:35px; }
.geometry-answer input::placeholder { color:#fff3d68c; font-size:.63rem; }
.geometry-answer input:focus-visible { outline:1px solid currentColor; outline-offset:2px; }
.geometry-operator:focus-visible { outline:1px solid currentColor; outline-offset:2px; }
.geometry-answer input[aria-invalid="true"] { border-bottom-color:#6c2a19; box-shadow:0 1px #6c2a19; }
.geometry-operator[aria-invalid="true"] { border-bottom-color:#6c2a19; box-shadow:0 1px #6c2a19; }
.geometry-answer button { min-width:46px; background:#fff3d6; color:#80501a; }
.geometry-answer button:hover { background:#fffbee; }
.geometry-answer button.is-correct { background:#fffbee; font-weight:600; }
.geometry-verdict { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.triangle-game[data-tool="height"] .geometry-board { cursor:crosshair; }
.triangle-pair-outline { fill:none; stroke:currentColor; stroke-width:2; pointer-events:none; }
.triangle-game [data-triangle-piece="2"] { opacity:.6; }
.triangle-game [data-triangle-piece="2"] polygon { fill-opacity:.25; }
.triangle-measurement { pointer-events:none; }
.triangle-base { stroke:#fffbe9; stroke-width:2.5; }
.triangle-height { stroke:#fffbe9; stroke-width:1.6; stroke-dasharray:4 3; pointer-events:none; }
.triangle-extension { stroke:currentColor; stroke-width:1; stroke-dasharray:2 3; }
.triangle-dimension { fill:#fffbe9; font:12px "SimHei","Microsoft YaHei",sans-serif; paint-order:stroke; stroke:color-mix(in srgb,var(--dialog-stage) 88%,#3b2118); stroke-width:3; stroke-linejoin:round; }
.triangle-height-anchor { fill:#fffbe9; pointer-events:none; }
.triangle-height-draft { pointer-events:none; }
.triangle-height-end { fill:#fffbe9; }
.lesson-dialog:has([data-geometry-game]):focus { outline:none; }
.is-compact .geometry-game { display:none; }
@media(max-width:900px) {
  .has-geometry-game:not(.is-compact) .lesson-dialog-header { min-height:0; padding-right:clamp(1.5rem,5vw,4.5rem); }
  .geometry-game { position:relative; top:auto; left:auto; right:auto; width:min(100%,540px); margin:25px auto 0; }
}
@media(max-height:650px) and (min-width:560px) {
  .has-geometry-game:not(.is-compact) .lesson-dialog-header { min-height:370px; padding:25px 450px 18px 28px; }
  .geometry-game { position:absolute; top:40px; right:60px; left:auto; width:360px; margin:0; }
  .geometry-tools { gap:4px; }
  .geometry-tools button { padding-inline:7px; }
  .geometry-answer { gap:4px; font-size:.75rem; }
  .geometry-answer input { width:34px; }
  .geometry-operator { flex-basis:27px; width:27px; }
  .triangle-game .geometry-answer { gap:3px; }
  .triangle-game .geometry-answer input { width:29px; }
  .geometry-answer button { min-width:42px; }
  .has-geometry-game:not(.is-compact) .version-panel { padding-block:8px; }
}
@media(max-width:680px), (pointer:coarse) and (max-height:500px) {
  .geometry-game { display:none; }
  .lesson-dialog-inner.has-geometry-game:not(.is-compact) .lesson-dialog-header { min-height:0; padding:calc(3.7rem + env(safe-area-inset-top)) 1rem 1.15rem; }
}
