*{box-sizing:border-box}html,body,#root{width:100%;height:100%;margin:0}body{min-width:1024px;color:#182230;font-family:Inter,Microsoft YaHei,PingFang SC,Arial,sans-serif;background:#f2f4f7}button{font:inherit}.top-bar{height:48px;flex:0 0 48px;display:flex;align-items:center;justify-content:space-between;padding:0 14px 0 18px;color:#334155;background:#fff5df;border-bottom:1px solid #ead7b4}.project-title{font-size:16px;font-weight:700}.toolbar-actions{display:flex;align-items:center;gap:8px}.toolbar-actions button{height:32px;min-width:58px;padding:0 12px;color:#172033;background:#fff;border:1px solid #e0d3bd;border-radius:6px;cursor:pointer}.toolbar-actions select{height:32px;min-width:220px;max-width:280px;padding:0 10px;color:#172033;background:#fff;border:1px solid #e0d3bd;border-radius:6px;cursor:pointer}.toolbar-actions select:hover,.toolbar-actions button:hover{background:#fff7e8;border-color:#f4b94f}.toolbar-actions button:active{transform:translateY(1px)}.blockly-workspace{position:relative;width:100%;height:100%;overflow:hidden}.blockly-workspace .blocklyToolboxDiv{border-right:1px solid #d8dee5;box-shadow:3px 0 10px #0f172a0d}.blockly-workspace .blocklyTreeRow{min-height:36px;margin:4px 8px;border-radius:6px}.blockly-workspace .blocklyTreeLabel{font-family:Inter,Microsoft YaHei,PingFang SC,Arial,sans-serif;font-size:13px;font-weight:600}.blockly-workspace .blocklyTreeSelected{color:#0f172a;background-color:#e8edf1!important}.blockly-workspace .blocklyFlyout{filter:drop-shadow(3px 0 9px rgb(15 23 42 / 7%))}.blockly-workspace .blocklyFlyoutBackground{fill:#fff;stroke:#d8dee5;stroke-width:1px}.blockly-workspace .blocklyFlyoutLabelText{fill:#334155;font-size:17px;font-weight:700}.blockly-workspace .blocklyText{font-family:Inter,Microsoft YaHei,PingFang SC,Arial,sans-serif}.boardcraft-dialog-overlay{position:fixed;inset:0;z-index:1000;background:#0f172a73}.boardcraft-dialog{position:absolute;top:108px;left:50%;width:min(366px,calc(100vw - 48px));overflow:hidden;background:#fff;border:4px solid #b8b8b8;border-radius:8px;box-shadow:0 10px 24px #0f172a3d;transform:translate(-50%)}.boardcraft-dialog-header{height:52px;display:flex;align-items:center;justify-content:center;position:relative;color:#fff;background:#ffae2b}.boardcraft-dialog-header h2{margin:0;font-size:16px;font-weight:700}.boardcraft-dialog-close{position:absolute;top:10px;right:12px;width:30px;height:30px;padding:0;color:#fff;background:#99600a59;border:0;border-radius:50%;font-size:24px;font-weight:700;line-height:28px;cursor:pointer}.boardcraft-dialog-body{padding:26px 34px 24px}.boardcraft-dialog-label{display:block;margin-bottom:12px;color:#1f2937;font-size:15px;font-weight:700}.boardcraft-dialog-input{width:100%;height:48px;padding:0 12px;color:#111827;background:#fff;border:1px solid #d1d5db;border-radius:5px;font-size:16px;outline:none}.boardcraft-dialog-input:focus{border-color:#ffae2b;box-shadow:0 0 0 3px #ffae2b38}.boardcraft-dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:24px}.boardcraft-dialog-button{min-width:60px;height:46px;padding:0 16px;color:#4b5563;background:#fff;border:1px solid #d1d5db;border-radius:5px;font-size:14px;font-weight:700;cursor:pointer}.boardcraft-dialog-button.primary{color:#fff;background:#4d8ff7;border-color:#4d8ff7}.boardcraft-dialog-button:hover,.boardcraft-dialog-close:hover{filter:brightness(.96)}.sim-feedback,.sim-empty{padding:12px;margin-bottom:12px;border-radius:8px;font-size:13px;line-height:1.5;overflow-wrap:anywhere}.sim-feedback{color:#334155;background:#eef2f7;border:1px solid #cbd5e1}.sim-feedback.success{color:#14532d;background:#dcfce7;border-color:#86efac}.sim-feedback.error{color:#7f1d1d;background:#fee2e2;border-color:#fca5a5}.sim-feedback.running{color:#0f3f6e;background:#dbeafe;border-color:#93c5fd}.sim-feedback.waiting{color:#713f12;background:#fef3c7;border-color:#facc15}.sim-feedback.looping{color:#064e3b;background:#d1fae5;border-color:#6ee7b7}.sim-feedback.stopped{color:#4b5563;background:#f3f4f6;border-color:#d1d5db}.sim-feedback.warning{color:#713f12;background:#fef3c7;border-color:#facc15}.sim-feedback.info{color:#334155;background:#eef2f7;border-color:#cbd5e1}.sim-empty{color:#64748b;text-align:center;background:#fff;border:1px dashed #94a3b8}.sim-card{padding:14px;margin-bottom:12px;overflow:visible;background:#fff;border:1px solid #d7dee8;border-radius:8px}.sim-card h2{margin:0 0 12px;font-size:15px;line-height:1.3}.mpython-simulator{display:grid;gap:12px}.mpython-board-shell{position:relative;width:100%;padding:6px;background:transparent;border:0;border-radius:8px;overflow:visible}.mpython-board-svg{width:100%;height:auto;display:block;overflow:visible}.mpython-board-art{line-height:0}.mpython-board-art .mpython-board-hotspot{cursor:pointer;outline:none;pointer-events:bounding-box}.mpython-board-art #layer_99_reference_bounds{display:none}.mpython-board-art #rgb_1,.mpython-board-art #rgb_2,.mpython-board-art #rgb_3,.mpython-board-art #touch_P,.mpython-board-art #touch_Y,.mpython-board-art #touch_T,.mpython-board-art #touch_H,.mpython-board-art #touch_O,.mpython-board-art #touch_N{transition:filter .16s ease,opacity .16s ease}.mpython-board-art[data-led-1=on] #rgb_1 circle{fill:var(--mpython-rgb-color-1, var(--mpython-rgb-color));filter:drop-shadow(0 0 18px var(--mpython-rgb-color-1, var(--mpython-rgb-color)))}.mpython-board-art[data-led-2=on] #rgb_2 circle{fill:var(--mpython-rgb-color-2, var(--mpython-rgb-color));filter:drop-shadow(0 0 18px var(--mpython-rgb-color-2, var(--mpython-rgb-color)))}.mpython-board-art[data-led-3=on] #rgb_3 circle{fill:var(--mpython-rgb-color-3, var(--mpython-rgb-color));filter:drop-shadow(0 0 18px var(--mpython-rgb-color-3, var(--mpython-rgb-color)))}.mpython-board-art[data-buzzer=on] #layer_03_buzzer{filter:drop-shadow(0 0 18px #f59e0b) brightness(1.16)}.mpython-board-art[data-touch-p=on] #touch_P,.mpython-board-art[data-touch-y=on] #touch_Y,.mpython-board-art[data-touch-t=on] #touch_T,.mpython-board-art[data-touch-h=on] #touch_H,.mpython-board-art[data-touch-o=on] #touch_O,.mpython-board-art[data-touch-n=on] #touch_N{filter:drop-shadow(0 0 16px #f6e86a)}.mpython-board-art[data-button-a=on] #g71,.mpython-board-art[data-button-b=on] #g70{filter:drop-shadow(0 0 14px #38bdf8) brightness(1.18)}.mpython-board-art[data-active-input=button-A] #g71,.mpython-board-art[data-active-input=button-B] #g70,.mpython-board-art[data-active-input=touch-P] #touch_P,.mpython-board-art[data-active-input=touch-Y] #touch_Y,.mpython-board-art[data-active-input=touch-T] #touch_T,.mpython-board-art[data-active-input=touch-H] #touch_H,.mpython-board-art[data-active-input=touch-O] #touch_O,.mpython-board-art[data-active-input=touch-N] #touch_N,.mpython-board-art[data-active-input=microphone] #layer_07_microphone,.mpython-board-art[data-active-input=light] #layer_08_light_sensor,.mpython-board-art[data-active-input=motion] #layer_04_pose_sensor{filter:drop-shadow(0 0 18px #0ea5e9) brightness(1.16)}.mpython-hotspot-popover{position:absolute;z-index:6;width:min(252px,calc(100% - 16px));padding:10px;color:#172033;background:#fff;border:1px solid #d7dee8;border-radius:8px;box-shadow:0 14px 28px #0f172a33}.mpython-hotspot-popover[data-placement=top-left]{top:12px;left:8px}.mpython-hotspot-popover[data-placement=top-right]{top:12px;right:8px}.mpython-hotspot-popover[data-placement=middle-left]{top:32%;left:8px}.mpython-hotspot-popover[data-placement=middle-right]{top:32%;right:8px}.mpython-hotspot-popover[data-placement=bottom]{bottom:8px;left:50%;transform:translate(-50%)}.mpython-hotspot-popover[data-placement=center]{top:28%;left:50%;transform:translate(-50%)}.mpython-popover-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.mpython-popover-head h3{margin:0;color:#0f172a;font-size:13px;line-height:1.2}.mpython-popover-head button{width:24px;height:24px;padding:0;color:#475569;background:#f1f5f9;border:1px solid #cbd5e1;border-radius:50%;line-height:20px;cursor:pointer}.mpython-popover-body{display:grid;gap:8px}.mpython-popover-toggle{width:100%;min-width:0;height:32px;padding:0 10px;color:#334155;background:#f8fafc;border:1px solid #cbd5e1;border-radius:6px;font-size:12px;cursor:pointer}.mpython-popover-toggle.active{color:#0f3f6e;background:#dbeafe;border-color:#60a5fa;font-weight:700}.mpython-popover-note{color:#64748b;font-size:11px}.mpython-oled-runtime{color:#a7f3d0}.mpython-oled-text{fill:#a7f3d0;font-family:Consolas,Liberation Mono,monospace;font-weight:700;paint-order:stroke;stroke:#0000004d;stroke-width:.35px}.mpython-oled-shape{color:#a7f3d0;fill:currentColor;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round}.mpython-summary{display:grid;grid-template-columns:1fr;gap:8px}.mpython-summary-item{display:grid;grid-template-columns:62px 1fr;align-items:baseline;gap:8px;min-width:0;padding:8px 10px;color:#334155;background:#f8fafc;border:1px solid #d7dee8;border-radius:6px;font-size:13px}.mpython-summary-item strong{min-width:0;overflow-wrap:anywhere;color:#0f172a;font-family:Consolas,Liberation Mono,monospace;font-size:13px}.mpython-rgb-status{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.mpython-rgb-status span{min-width:0;display:flex;align-items:center;justify-content:center;gap:5px;padding:6px;overflow:hidden;color:#475569;text-overflow:ellipsis;white-space:nowrap;background:#f8fafc;border:1px solid #d7dee8;border-radius:6px;font-family:Consolas,Liberation Mono,monospace;font-size:11px}.mpython-rgb-status span[data-active=true]{color:#0f172a;background:#fff7ed;border-color:#fdba74;font-weight:700}.mpython-rgb-status i{width:10px;height:10px;flex:0 0 10px;border:1px solid #ffffff;border-radius:50%;box-shadow:0 0 0 1px #cbd5e1}.mpython-input-section{min-width:0;padding:10px;background:#f8fafc;border:1px solid #d7dee8;border-radius:6px}.mpython-input-section h3{margin:0 0 8px;color:#0f172a;font-size:13px;line-height:1.2}.mpython-toggle-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}.mpython-toggle-row button,.mpython-touch-card button{min-width:0;height:30px;padding:0 8px;color:#334155;background:#fff;border:1px solid #cbd5e1;border-radius:6px;font-size:12px;cursor:pointer}.mpython-toggle-row button.active,.mpython-touch-card button.active{color:#0f3f6e;background:#dbeafe;border-color:#60a5fa;font-weight:700}.mpython-touch-grid{display:grid;grid-template-columns:1fr;gap:8px}.mpython-touch-card{min-width:0;padding:8px;background:#fff;border:1px solid #e2e8f0;border-radius:6px}.mpython-touch-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;color:#334155;font-size:12px;font-weight:700}.mpython-touch-card small{display:block;margin-top:4px;color:#64748b;font-size:11px}.mpython-range-field{display:grid;grid-template-columns:42px minmax(0,1fr) 62px;align-items:center;gap:8px;min-width:0;margin-top:8px;color:#334155;font-size:12px}.mpython-range-field:first-of-type{margin-top:0}.mpython-range-field input[type=range]{width:100%;min-width:0}.mpython-range-field input[type=number]{width:100%;height:28px;min-width:0;padding:0 6px;color:#172033;border:1px solid #cbd5e1;border-radius:6px;font-size:12px}.mpython-select-field{display:grid;grid-template-columns:42px minmax(0,1fr);align-items:center;gap:8px;color:#334155;font-size:12px}.mpython-select-field select{width:100%;height:30px;min-width:0;padding:0 8px;color:#172033;background:#fff;border:1px solid #cbd5e1;border-radius:6px}.mpython-checkbox-field{display:flex;align-items:center;gap:8px;margin-top:8px;color:#334155;font-size:12px}.mpython-input-status{display:flex;flex-wrap:wrap;gap:6px}.mpython-input-status span{max-width:100%;padding:5px 8px;overflow:hidden;color:#334155;text-overflow:ellipsis;white-space:nowrap;background:#f8fafc;border:1px solid #d7dee8;border-radius:999px;font-size:12px}.mpython-placeholder-list{display:flex;flex-wrap:wrap;gap:6px}.mpython-placeholder-list span{max-width:100%;padding:5px 8px;overflow:hidden;color:#475569;text-overflow:ellipsis;white-space:nowrap;background:#eef2f7;border:1px dashed #94a3b8;border-radius:999px;font-size:12px}@media(max-height:780px){.mpython-board-shell{padding:6px}.mpython-placeholder-list span{font-size:11px}.mpython-input-panel{gap:8px}.mpython-input-section{padding:8px}.mpython-range-field{grid-template-columns:38px minmax(0,1fr) 56px;gap:6px}}.oled-screen,.lcd-screen{display:flex;align-items:center;justify-content:center;height:82px;padding:8px;margin-bottom:12px;border-radius:6px;font-weight:700;overflow:hidden;text-align:center;overflow-wrap:anywhere}.oled-screen{color:#85efac;background:#10151f;border:2px solid #1f2937}.lcd-screen{color:#083344;background:linear-gradient(135deg,#7dd3fc,#fef08a);border:2px solid #60a5fa}.camera-placeholder{width:72px;height:72px;display:flex;align-items:center;justify-content:center;margin:0 auto 12px;color:#e5e7eb;background:#3f4a5c;border-radius:50%;font-size:13px}.rgb-row,.button-row{display:flex;align-items:center;gap:10px;margin-bottom:12px}.rgb-dot{width:18px;height:18px;display:inline-block;border-radius:50%;border:2px solid #ffffff;box-shadow:0 0 0 1px #cbd5e1}.rgb-dot.red{background:#ef4444}.rgb-dot.green{background:#22c55e}.rgb-dot.blue{background:#3b82f6}.rgb-dot.cyan{background:#06b6d4}.sim-field{display:grid;grid-template-columns:72px 22px 1fr;align-items:center;gap:10px;margin-bottom:12px;font-size:13px}.sim-value{color:#475569;font-family:Consolas,Liberation Mono,monospace}.button-row button{height:30px;padding:0 12px;color:#1f2937;background:#eef2f7;border:1px solid #cbd5e1;border-radius:6px}.sensor-control{display:grid;grid-template-columns:minmax(70px,max-content) minmax(0,1fr);align-items:center;gap:10px;margin-top:10px;font-size:13px}.sensor-control input{width:100%}.module-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;min-width:0}.ultrasonic-control{padding:10px;margin-bottom:14px;background:#f8fafc;border:1px solid #d7dee8;border-radius:6px}.sensor-heading{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:8px;font-size:13px}.sensor-heading strong{color:#0f172a;font-size:18px}.ultrasonic-control input[type=range]{width:100%;margin-bottom:10px}.ultrasonic-control label{display:grid;grid-template-columns:72px 1fr;align-items:center;gap:8px;color:#334155;font-size:13px}.ultrasonic-control input[type=number]{width:100%;height:30px;padding:0 8px;color:#172033;border:1px solid #cbd5e1;border-radius:6px}.ultrasonic-control p{margin:8px 0 0;color:#64748b;font-size:12px}.module-tile{min-height:58px;display:flex;align-items:center;justify-content:center;padding:8px;text-align:center;color:#334155;background:#f3f6fa;border:1px dashed #9aa9bc;border-radius:6px;font-size:13px;overflow-wrap:anywhere}.module-tile.active{color:#0f3f6e;background:#dbeafe;border-style:solid;border-color:#93c5fd}.servo-readout{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:10px;font-size:13px}.servo-readout strong{font-size:22px;color:#0f172a}.servo-track{position:relative;width:120px;height:120px;margin:0 auto 14px;background:#eef2f7;border:1px solid #cbd5e1;border-radius:50%}.servo-track:before{position:absolute;inset:50% auto auto 50%;width:10px;height:10px;content:"";background:#334155;border-radius:50%;transform:translate(-50%,-50%)}.servo-track span{position:absolute;top:56px;left:60px;width:46px;height:8px;display:block;background:#0ea5e9;border-radius:999px;transform-origin:0 50%}@media(max-height:780px){.sim-feedback,.sim-empty{padding:10px;margin-bottom:8px;font-size:12px}.sim-card{padding:10px;margin-bottom:8px}.sim-card h2{margin-bottom:8px}.oled-screen,.lcd-screen{height:68px;margin-bottom:8px}.camera-placeholder{width:56px;height:56px;margin-bottom:8px}.sensor-control,.sim-field,.rgb-row,.button-row,.servo-readout{margin-bottom:8px}.ultrasonic-control{padding:8px;margin-bottom:10px}.module-grid{gap:8px}.module-tile{min-height:48px;padding:6px;font-size:12px}.servo-track{width:96px;height:96px;margin-bottom:10px}.servo-track span{top:44px;left:48px;width:38px}}.app{height:100vh;display:flex;flex-direction:column;overflow:hidden}.main-layout{flex:1;min-height:0;display:flex;overflow:hidden;background:#eef3f8}.blockly-area{flex:1;min-width:0;min-height:0;border-right:1px solid #cfd7e3}.simulator-panel{width:360px;flex:0 0 360px;min-height:0;max-height:calc(100vh - 48px);padding:12px;overflow-y:auto;scrollbar-gutter:stable;background:#f8fafc}@media(max-height:780px){.simulator-panel{padding:8px}}
