.problem-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; padding: 18px 0 22px; border-bottom: 1px solid var(--line); }
.problem-heading h1 { font-size: 27px; line-height: 1.35; }
.problem-tags { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.problem-layout { display: grid; grid-template-columns: 322px minmax(0,1fr); gap: 28px; align-items: start; }
.problem-import { padding: 24px 20px 24px 0; border-right: 1px solid var(--line); min-width: 0; }
.problem-import h2 { margin-bottom: 15px; font-size: 18px; }
.problem-import form { display: grid; gap: 15px; }
.problem-import input,.problem-import select { min-width: 0; width: 100%; }
#problemFile { padding: 10px 6px; border-style: dashed; background: #edf3f0; font-size: 12px; }
.problem-file-state,.problem-quota,.problem-permission { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.problem-import details { border-block: 1px solid var(--line); padding: 12px 0; }
.problem-import details label { margin-top: 12px; }
.problem-import summary,.problem-json summary { font-size: 13px; cursor: pointer; color: #335a5c; }
.problem-actions,.problem-library-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#problemImportForm .problem-actions { display: grid; grid-template-columns: 1fr; }
.problem-actions .button,.problem-run-form .button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.problem-actions svg,.problem-run-form svg,.problem-template-link svg { width: 17px; height: 17px; flex: 0 0 17px; }
.problem-template-links { display: grid; gap: 12px; margin: 20px 0 28px; }
.problem-family-templates { grid-column: 1/-1; }
.problem-family-templates a { margin-top: 10px; }
.problem-model-check { padding: 14px; margin: 16px 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.problem-model-check h3 { margin: 0; font-size: 16px; }
.problem-check-table { max-height: 300px; }
.problem-check-table td { white-space: normal; vertical-align: top; }
#problemCheckBadge[data-state="pending"] { color: var(--amber); background: var(--theme-soft); }
.problem-template-link { display: flex; align-items: center; gap: 8px; color: #296b67; font-size: 14px; line-height: 1.6; text-decoration: none; }
.problem-template-link:hover { text-decoration: underline; }
.problem-library-heading { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; }
.problem-library-heading h2 { margin: 0; }
.problem-library-actions { margin-top: 12px; }
.problem-builtin-info { padding: 14px 16px; margin: 14px 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.problem-builtin-info summary { color: var(--ink); font-size: 14px; font-weight: 650; cursor: pointer; }
.problem-builtin-info dl { display: grid; grid-template-columns: 90px minmax(0,1fr); gap: 9px 14px; margin: 14px 0 0; font-size: 13px; line-height: 1.65; }
.problem-builtin-info dt { color: var(--muted); }
.problem-builtin-info dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.problem-description { white-space: pre-line; }
.problem-formulas { padding-left: 24px; color: var(--ink); }
.problem-formulas li { margin: 8px 0; overflow-wrap: anywhere; font: 13px/1.75 Consolas,"Microsoft YaHei",monospace; white-space: pre-wrap; }
.problem-builtin-info td { white-space: normal; min-width: 120px; vertical-align: top; }
.problem-builtin-info .problem-recommended { background: var(--theme-soft); border-left: 3px solid var(--green); }
.problem-parameter-table { max-height: 280px; }
.problem-parameter-table td { min-width: 72px; font-variant-numeric: tabular-nums; }
#problemParameterTable caption { text-align: left; margin-bottom: 8px; color: var(--ink); font-size: 14px; font-weight: 650; }
.problem-replay-picker { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 12px; }
.problem-replay-picker label { flex: 1 1 220px; }
.problem-replay-picker select { width: 100%; min-width: 0; }
.problem-preview .playback-bar > button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-shrink: 0; }
.problem-preview .playback-bar > button svg { width: 16px; height: 16px; }
.problem-content { min-width: 0; }
.problem-content > section { padding: 23px 0; border-bottom: 1px solid var(--line); }
.problem-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.problem-section-heading h2 { font-size: 19px; line-height: 1.4; overflow-wrap: anywhere; }
.problem-badge { flex: 0 0 auto; padding: 5px 8px; font-size: 12px; background: #e7efeb; color: #345b50; }
.problem-badge[data-state="error"] { color: #963f32; background: #fae9e3; }
.problem-message { margin: 10px 0; font-size: 13px; color: #536465; line-height: 1.65; overflow-wrap: anywhere; }
.problem-message[data-state="error"] { color: #963f32; }
.problem-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 18px 0; border-block: 1px solid var(--line); }
.problem-summary div { padding: 14px 12px; min-width: 0; border-right: 1px solid var(--line); }
.problem-summary div:last-child { border: 0; }
.problem-summary dt { font-size: 12px; color: var(--muted); }
.problem-summary dd { margin: 7px 0 0; font-size: 17px; font-weight: 650; overflow-wrap: anywhere; }
#problemSourceHash { font-size: 12px; padding-top: 4px; }
.problem-content th,.problem-content td { padding: 10px; font-size: 12px; }
.problem-content td { overflow-wrap: anywhere; max-width: 310px; }
.problem-content td input[type="checkbox"] { min-width: 18px; min-height: 18px; width: 18px; height: 18px; }
.problem-case-errors { margin: 4px 0 0; padding: 0; list-style: none; color: #963f32; font-size: 11px; }
.problem-json { margin-top: 14px; }
.problem-json pre { max-height: 310px; overflow: auto; background: #edf1ef; padding: 14px; font-size: 12px; white-space: pre; }
.problem-preview canvas { display: block; width: 100%; height: 420px; background: #d5dcd9; }
.problem-preview .workspace-view-stage > canvas { height: clamp(180px,calc(100svh - var(--scene-scroll-offset) - var(--scene-chrome-height,180px)),440px); }
.problem-run-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.problem-run-form input,.problem-run-form select { min-width: 0; width: 100%; }
.problem-run-form > label { flex: 1 1 150px; }
.problem-algorithm-fields { flex: 1 1 100%; min-width: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 0; padding: 14px; border: 1px solid var(--line); }
.problem-algorithm-fields legend { color: var(--muted); font-size: 12px; padding-inline: 6px; }
.problem-algorithm-fields label { min-width: 0; }
.problem-compare-option { display: flex; align-items: center; gap: 8px; }
.problem-compare-option input { flex: 0 0 18px; width: 18px; min-height: 18px; height: 18px; margin: 0; }
#problemAlgorithmStatus { grid-column: 1/-1; margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.problem-version-detail { max-width: 300px; max-height: 220px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; color: var(--muted); }
.editor-header-actions { flex-wrap: wrap; }
.problem-history-select { margin-top: 20px; }
.problem-history-select label { flex: 1; min-width: 0; }
.problem-history-select select { width: 100%; min-width: 0; }
.problem-permission { color: #963f32; margin-top: 16px; }
.problem-row-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.problem-row-active { background: #e8f1ed; }
.problem-pending { color: #8b642d; }
.problem-pass { color: #167052; }
.problem-fail { color: #a13b35; }
@media (min-width: 901px) and (max-width: 1230px) {
  .topbar { height: auto; min-height: 72px; flex-wrap: wrap; padding-block: 8px; gap: 7px; }
  .workspace-switch { order: 3; width: 100%; }
  .workspace-tab { flex: 1; }
  .workspace-viewport { --scene-scroll-offset: 116px; }
}
@media (max-width: 900px) {
  .problem-layout { grid-template-columns: minmax(0,1fr); gap: 0; }
  .problem-import { padding: 20px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  #problemImportForm .problem-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .problem-template-links { grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 18px; }
}
@media (max-width: 620px) {
  #problemSolverGuide table { min-width: 0; width: 100%; }
  #problemSolverGuide thead { display: none; }
  #problemSolverGuide tbody { display: grid; gap: 10px; }
  #problemSolverGuide tr { display: grid; padding: 10px; border: 1px solid var(--line); }
  #problemSolverGuide td { display: block; min-width: 0; max-width: none; padding: 6px 0; border: 0; line-height: 1.65; }
  #problemSolverGuide td::before { content: attr(data-label) "："; color: var(--muted); font-weight: 650; }
  .problem-algorithm-fields { grid-template-columns: minmax(0,1fr); }
  .workspace-tab { min-width: 0; min-height: 42px; padding: 6px 4px; font-size: 11px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
  .problem-heading { align-items: start; flex-direction: column; gap: 12px; }
  .problem-heading h1 { font-size: 22px; }
  .problem-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .problem-summary div { border-bottom: 1px solid var(--line); }
  .problem-summary div:nth-child(2) { border-right: 0; }
  .problem-summary div:nth-child(3) { border-bottom: 0; }
  .problem-section-heading { align-items: start; flex-wrap: wrap; }
  .problem-content table { min-width: 610px; }
  .problem-tags { gap: 12px; }
}
.problem-matrix-options{grid-column:1/-1;min-width:0}
.problem-matrix-options input:not([type=checkbox]){width:100%;min-width:0}
.project-panel{margin-top:24px;min-width:0;padding:20px}
.project-panel>summary{cursor:pointer;font-size:18px}
.project-panel pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:320px;overflow:auto}
.project-panel textarea{max-width:100%;min-width:0}