:root{color:#1f2937;font-synthesis:none;text-rendering:optimizelegibility;background:#eef2f7;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans TC,Microsoft JhengHei,sans-serif}*{box-sizing:border-box}html,body{width:100%;height:100%;margin:0;overflow:hidden}body{background:#eef2f7;min-width:1180px}button,input,select{font-family:inherit}button{color:#fff;cursor:pointer;background:#2563eb;border:0;border-radius:10px;padding:10px 14px;font-size:15px;font-weight:700;transition:transform .12s,box-shadow .12s,background .12s}button:hover{background:#1d4ed8;transform:translateY(-1px);box-shadow:0 4px 12px #2563eb3d}button:active{box-shadow:none;transform:translateY(0)}button:disabled{opacity:.45;cursor:not-allowed;box-shadow:none;transform:none}.secondary-button{background:#475569}.secondary-button:hover{background:#334155}.success-button{background:#059669}.success-button:hover{background:#047857}.warning-button{background:#d97706}.warning-button:hover{background:#b45309}#btnSubmitScore{white-space:nowrap}#btnSubmitScore:disabled{color:#f8fafc;opacity:1;background:#94a3b8}.small-button{background:#64748b;border-radius:8px;padding:6px 10px;font-size:13px}.small-button:hover{background:#475569;box-shadow:0 4px 12px #4755693d}.success-small{background:#059669}.success-small:hover{background:#047857}.warning-small{background:#d97706}.warning-small:hover{background:#b45309}#app{flex-direction:column;height:100dvh;min-height:0;display:flex;overflow:hidden}.app-header{color:#fff;background:linear-gradient(135deg,#1e3a8a,#2563eb);flex:none;justify-content:space-between;align-items:center;gap:16px;padding:10px 22px;display:flex}.brand-block h1{letter-spacing:.5px;margin:0;font-size:24px}.brand-block p{opacity:.9;margin:2px 0 0;font-size:14px}.header-actions{flex-wrap:wrap;justify-content:flex-end;gap:8px;display:flex}.header-actions button{background:#ffffff2e;border:1px solid #ffffff52}.header-actions button:hover{background:#ffffff47;box-shadow:0 4px 12px #00000029}.course-bar{z-index:1;background:#fff;border-bottom:1px solid #cbd5e1;flex:none;grid-template-columns:minmax(86px,.75fr) minmax(76px,.65fr) minmax(130px,1fr) minmax(120px,.95fr) minmax(140px,1fr) minmax(150px,1.1fr) minmax(86px,.75fr) minmax(96px,.85fr) minmax(96px,.85fr) minmax(96px,.85fr);align-items:center;gap:10px;padding:8px 14px;display:grid;box-shadow:0 4px 12px #0f172a14}.course-bar button{white-space:nowrap;width:100%;min-height:36px;padding:7px 10px;font-size:14px}#btnLoadCourse{background:#1e40af}#btnLoadCourse:hover{background:#1e3a8a}#btnTestTask{background:#059669}#btnTestTask:hover{background:#047857}.field-group{grid-template-columns:auto 1fr;align-items:center;gap:8px;min-width:0;display:grid}.field-group span{white-space:nowrap;color:#475569;font-size:14px;font-weight:800}.field-group input,.field-group select{color:#0f172a;background:#f8fafc;border:1px solid #cbd5e1;border-radius:10px;outline:none;width:100%;min-width:0;min-height:36px;padding:7px 10px;font-size:14px}.field-group input:focus,.field-group select:focus{border-color:#2563eb;box-shadow:0 0 0 3px #2563eb24}.field-group.field-required-missing input{background:#fff7f7;border-color:#dc2626;box-shadow:0 0 0 3px #dc26261f}.profile-clear-button{white-space:nowrap;min-height:36px}.course-code-field input{letter-spacing:.5px;text-transform:uppercase;font-weight:800}.mode-display-field{align-self:stretch}.mode-status-pill{color:#1e40af;white-space:nowrap;background:#dbeafe;border:1px solid #bfdbfe;border-radius:999px;justify-content:center;align-items:center;min-height:36px;padding:7px 10px;font-size:14px;display:flex}.mode-status-pill.contest-mode{color:#92400e;background:#fef3c7;border-color:#f59e0b}.mode-status-pill.learning-mode{color:#1e40af;background:#dbeafe;border-color:#bfdbfe}.app-main{flex:auto;grid-template-columns:minmax(700px,1fr) 430px;gap:16px;min-height:0;padding:10px 14px;display:grid;overflow:hidden}.workspace-panel,.task-panel,.smartring-panel,.result-panel{background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 8px 20px #0f172a1a}.workspace-panel{flex-direction:column;min-height:0;display:flex}.workspace-tabs{background:#f8fafc;border-bottom:1px solid #e2e8f0;align-items:center;gap:6px;min-height:42px;padding:6px 10px;display:flex}.tab-button{color:#475569;box-shadow:none;background:#e2e8f0}.tab-button:hover{color:#1e3a8a;box-shadow:none;background:#dbeafe}.tab-button.active{color:#fff;background:#2563eb}.workspace-tab-actions{justify-content:flex-end;margin-left:auto;display:flex}.workspace-view{flex:1;min-height:0;display:none}.workspace-view.active{display:flex}#blocksView,#codeView{flex-direction:column}#blocklyDiv{flex:1;min-height:0}.side-panel{grid-template-rows:minmax(0,1.05fr) minmax(0,.85fr) minmax(0,1fr);gap:10px;min-height:0;display:grid}.side-panel.programming-problem{grid-template-rows:minmax(0,1.35fr) minmax(0,.75fr) minmax(0,1fr)}.panel-title{color:#334155;background:#f8fafc;border-bottom:1px solid #e2e8f0;justify-content:space-between;align-items:center;min-height:46px;padding:10px 14px;font-size:15px;font-weight:800;display:flex}.info-box,.smartring-info{color:#334155;background:#fff;height:calc(100% - 46px);padding:14px;overflow:auto}.info-box h2{color:#1e3a8a;margin:0 0 10px;font-size:18px}.info-box p,.smartring-info p{margin:8px 0;line-height:1.55}.info-box ul{margin:8px 0 0;padding-left:22px}.info-box li{margin:4px 0}.summary-note{color:#1e40af;background:#eff6ff;border-left:4px solid #2563eb;border-radius:8px;padding:8px 10px}.problem-task-fixed-panel h2{margin-bottom:6px}.problem-fixed-note{color:#92400e;background:#fffbeb;border-left:4px solid #f59e0b;border-radius:8px;padding:8px 10px;font-size:13px}.problem-code-badge{color:#1e40af;background:#dbeafe;border-radius:999px;margin:4px 0 10px;padding:4px 9px;font-family:Cascadia Code,Consolas,Courier New,monospace;font-size:13px;font-weight:800;display:inline-block}.problem-section{border-bottom:1px solid #e2e8f0;padding:10px 0}.problem-section:last-child{border-bottom:0}.problem-section h3{color:#1e3a8a;margin:0 0 6px;font-size:15px}.problem-section p{white-space:pre-wrap;margin:0;line-height:1.65}.problem-sample-block{-webkit-user-select:text;user-select:text;white-space:pre-wrap;color:#0f172a;background:#f8fafc;border:1px solid #cbd5e1;border-radius:10px;width:100%;margin:6px 0 0;padding:10px 12px;font-family:Cascadia Code,Consolas,Courier New,monospace;font-size:13px;line-height:1.55;overflow:auto}.smartring-test-actions{flex-wrap:wrap;gap:8px;margin:10px 0;display:flex}#serialStatusValue{color:#b45309;font-weight:800}#serialStatusValue.connected{color:#047857}#buttonStateValue{color:#1e3a8a;font-weight:800}#rawStateValue,#lastCommandValue{color:#0f172a;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;width:100%;max-height:64px;margin:6px 0 0;padding:8px;font-family:Cascadia Code,Consolas,Courier New,monospace;font-size:12px;line-height:1.45;overflow:auto}#lastCommandValue{color:#7c2d12;background:#fff7ed}#codePreview,#outputArea{white-space:pre-wrap;color:#0f172a;background:#f8fafc;width:100%;height:calc(100% - 46px);margin:0;padding:14px;font-family:Cascadia Code,Consolas,Courier New,monospace;font-size:13px;line-height:1.55;overflow:auto}#codePreview{height:100%}#outputArea{color:#064e3b;background:#ecfdf5}.app-footer{color:#475569;background:#e2e8f0;border-top:1px solid #cbd5e1;flex:none;grid-template-columns:1fr auto auto;align-items:center;gap:16px;min-height:30px;padding:6px 18px;font-size:13px;display:grid}#modeStatus{color:#1e40af;font-weight:800}#smartRingStatus{color:#b45309;font-weight:800}#smartRingStatus.connected{color:#047857}.blocklyToolboxDiv{border-right:1px solid #e2e8f0}.blocklyTreeLabel{font-family:Noto Sans TC,Microsoft JhengHei,sans-serif;font-size:16px}.blocklyFlyoutBackground{fill:#f8fafc}.modal-backdrop{z-index:1000;background:#0f172a8f;justify-content:center;align-items:center;padding:28px;display:none;position:fixed;inset:0}.modal-backdrop.active{display:flex}.modal-card{background:#fff;border-radius:18px;width:min(920px,96vw);max-height:88vh;overflow:hidden;box-shadow:0 24px 80px #0f172a5c}.modal-header{color:#fff;background:linear-gradient(135deg,#1e3a8a,#2563eb);justify-content:space-between;align-items:center;gap:16px;padding:16px 18px;display:flex}.modal-header h2{margin:0;font-size:22px}.modal-body{color:#334155;max-height:calc(88vh - 68px);padding:18px;overflow:auto}.modal-section{border-bottom:1px solid #e2e8f0;padding:12px 0}.modal-section:first-child{padding-top:0}.modal-section:last-child{border-bottom:0}.modal-section h3{color:#1e3a8a;margin:0 0 8px;font-size:18px}.modal-section p{margin:6px 0;line-height:1.65}.problem-title{color:#1e3a8a;text-align:center;margin:6px 0 12px;font-size:22px}.problem-example-section{border-bottom:0}.problem-example-table-wrap{background:#fff;border:2px solid #1f2937;border-radius:8px;width:100%;margin-top:8px;overflow:auto}.problem-example-table{border-collapse:collapse;table-layout:fixed;width:100%;min-width:520px;font-size:14px}.problem-example-table th,.problem-example-table td{vertical-align:top;border:2px solid #1f2937;padding:8px 10px}.problem-example-table th{text-align:left;color:#0f172a;background:#f1f5f9}.problem-example-table th:first-child,.problem-example-table td:first-child,.problem-example-table th:nth-child(2),.problem-example-table td:nth-child(2){width:29%}.problem-table-pre{white-space:pre-wrap;margin:0;font-family:inherit;line-height:1.6}.problem-example-explanation-pre{white-space:pre-wrap}.panel-title-clickable{padding:0}.panel-toggle-button{width:100%;min-height:46px;color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;justify-content:space-between;align-items:center;padding:10px 14px;display:flex}.panel-toggle-button:hover,.panel-toggle-button:focus-visible{background:#eef2ff;outline:none}.panel-toggle-text{color:#475569;font-size:13px}.smartring-panel.collapsed .panel-title{border-bottom:0}.task-panel-title{gap:8px;position:relative}.task-panel-title .panel-toggle-button{padding-right:132px}.task-modal-button{z-index:1;position:absolute;top:7px;right:10px}.task-panel.collapsed .panel-title{border-bottom:0}.result-panel-title{gap:8px;position:relative}.result-panel-title .panel-toggle-button{padding-right:96px}.result-clear-button{z-index:1;position:absolute;top:7px;right:10px}.result-panel.collapsed .panel-title{border-bottom:0}.public-course-list{margin:10px 0 14px;padding-left:0;list-style:none}.public-course-list li{background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;margin:6px 0;padding:8px 10px}.public-course-list code{color:#1e40af;background:#dbeafe;border-radius:6px;min-width:64px;margin-right:6px;padding:2px 6px;font-weight:800;display:inline-block}.output-area{white-space:pre-wrap;color:#064e3b;background:#ecfdf5;width:100%;height:calc(100% - 46px);margin:0;padding:14px;font-family:Cascadia Code,Consolas,Courier New,monospace;font-size:13px;line-height:1.55;overflow:auto}.assessment-report,.score-upload-preview{white-space:normal;color:#0f172a;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans TC,Microsoft JhengHei,sans-serif}.assessment-report h2,.score-upload-preview h2{color:#065f46;margin:0 0 12px;font-size:20px}.assessment-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:12px;display:grid}.assessment-summary-card{background:#f0fdf4;border:1px solid #bbf7d0;border-radius:12px;padding:10px}.assessment-summary-card.failed{background:#fef2f2;border-color:#fecaca}.assessment-summary-card.passed{background:#dcfce7;border-color:#86efac}.assessment-summary-card span,.assessment-summary-card small{color:#475569;font-size:12px;display:block}.assessment-summary-card strong{color:#0f172a;margin:4px 0;font-size:18px;display:block}.assessment-table-wrap{background:#fff;border:1px solid #cbd5e1;border-radius:12px;overflow:auto}.assessment-table,.score-upload-table{border-collapse:collapse;width:100%;font-size:13px}.assessment-table th,.assessment-table td,.score-upload-table th,.score-upload-table td{vertical-align:top;border-bottom:1px solid #e2e8f0;padding:8px 10px}.assessment-table th,.score-upload-table th{text-align:left;color:#334155;background:#f8fafc}.assessment-table tr:last-child td,.score-upload-table tr:last-child th,.score-upload-table tr:last-child td{border-bottom:0}.assessment-row.passed{background:#f0fdf4}.assessment-row.failed{background:#fff7ed}.assessment-case-number{text-align:center;width:48px;font-weight:800}.assessment-badge{text-align:center;border-radius:999px;min-width:58px;padding:4px 8px;font-weight:800;display:inline-block}.assessment-badge.passed{color:#065f46;background:#bbf7d0}.assessment-badge.failed{color:#9a3412;background:#fed7aa}.assessment-pre,.score-payload-pre{white-space:pre-wrap;word-break:break-word;-webkit-user-select:text;user-select:text;margin:0;font-family:Cascadia Code,Consolas,Courier New,monospace;font-size:12px;line-height:1.45}.assessment-error{color:#991b1b;background:#fee2e2;border-radius:8px;margin-top:6px;padding:6px 8px}.assessment-note{color:#92400e;background:#fffbeb;border-left:4px solid #f59e0b;border-radius:8px;margin:8px 0 12px;padding:8px 10px}.score-upload-table{background:#fff;border:1px solid #cbd5e1;border-radius:12px;margin-bottom:12px;overflow:hidden}.score-upload-table th{width:110px}.score-payload-pre{color:#0f172a;background:#f8fafc;border:1px solid #cbd5e1;border-radius:10px;padding:10px}.assessment-note.passed{color:#065f46;background:#ecfdf5;border-left-color:#10b981}.assessment-note.failed{color:#991b1b;background:#fef2f2;border-left-color:#ef4444}.course-manager-card{width:min(1120px,92vw)}.manager-note{color:#1e3a8a;background:#eff6ff;border-left:4px solid #2563eb;border-radius:10px;margin:0 0 12px;padding:10px 12px}.course-manager-table-wrap{background:#fff;border:1px solid #cbd5e1;border-radius:12px;overflow:auto}.course-manager-table{border-collapse:collapse;width:100%;font-size:13px}.course-manager-table th,.course-manager-table td{vertical-align:top;border-bottom:1px solid #e2e8f0;padding:9px 10px}.course-manager-table th{z-index:1;text-align:left;color:#334155;background:#f8fafc;position:sticky;top:0}.course-manager-table tr:last-child td{border-bottom:0}.course-manager-table code{color:#1e40af;background:#dbeafe;border-radius:6px;min-width:64px;padding:3px 7px;font-weight:800;display:inline-block}.course-health-badge{text-align:center;border-radius:999px;min-width:48px;margin-right:6px;padding:3px 8px;font-weight:800;display:inline-block}.course-health-badge.ok{color:#065f46;background:#bbf7d0}.course-health-badge.warning{color:#92400e;background:#fde68a}.course-health-badge.error{color:#991b1b;background:#fecaca}.course-manager-table small{color:#64748b;margin-top:4px;line-height:1.4;display:block}.student-task-content h2{margin-top:0}.scaffold-link{color:#3f51b5;background:#eef2ff;border:1px solid #c5cae9;border-radius:8px;margin:8px 0;padding:6px 12px;font-size:.85rem;font-weight:700;text-decoration:none;display:inline-block}.scaffold-link:hover{background:#dde3fb}.student-task-section ol{margin:8px 0 0 1.25rem;padding:0}.student-task-section li{margin:4px 0;line-height:1.55}.status-bar a,.footer-status a{color:#1d4ed8;font-weight:600;text-decoration:none}.status-bar a:hover,.footer-status a:hover{text-decoration:underline}.side-panel.smart-ring-collapsed{grid-template-rows:minmax(0,1.15fr) 42px minmax(0,1fr)}.side-panel.programming-problem.smart-ring-collapsed{grid-template-rows:minmax(0,1.35fr) 42px minmax(0,1fr)}.side-panel.task-panel-collapsed{grid-template-rows:42px minmax(0,.85fr) minmax(0,1fr)}.side-panel.programming-problem.task-panel-collapsed{grid-template-rows:42px minmax(0,.75fr) minmax(0,1fr)}.side-panel.smart-ring-collapsed.task-panel-collapsed{grid-template-rows:42px 42px minmax(0,1fr)}.side-panel.result-panel-collapsed{grid-template-rows:minmax(0,1.05fr) minmax(0,.85fr) 42px}.side-panel.programming-problem.result-panel-collapsed{grid-template-rows:minmax(0,1.35fr) minmax(0,.75fr) 42px}.side-panel.smart-ring-collapsed.result-panel-collapsed{grid-template-rows:minmax(0,1.15fr) 42px 42px}.side-panel.programming-problem.smart-ring-collapsed.result-panel-collapsed{grid-template-rows:minmax(0,1.35fr) 42px 42px}.side-panel.task-panel-collapsed.result-panel-collapsed{grid-template-rows:42px minmax(0,.85fr) 42px}.side-panel.programming-problem.task-panel-collapsed.result-panel-collapsed{grid-template-rows:42px minmax(0,.75fr) 42px}.side-panel.smart-ring-collapsed.task-panel-collapsed.result-panel-collapsed{grid-template-rows:42px 42px 42px}.dual-output-panes{flex-direction:column;gap:10px;height:100%;display:flex}.output-pane{border-radius:10px;flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.output-pane h3{flex:none;margin:0;padding:6px 10px;font-size:12px;font-weight:800}.output-pane-content{white-space:pre-wrap;flex:1;min-height:0;margin:0;padding:10px;font-family:Cascadia Code,Consolas,Courier New,monospace;font-size:13px;line-height:1.55;overflow:auto}.output-pane-system{border:1px solid #cbd5e1}.output-pane-system h3{color:#475569;background:#f1f5f9}.output-pane-system .output-pane-content{color:#334155;background:#f8fafc}.output-pane-say{border:1px solid #a7d7c5}.output-pane-say h3{color:#fff;background:#5ba58c}.output-pane-say .output-pane-content{color:#064e3b;background:#ecfdf5}
