:root {
      --bg-color: #ffffff;
      --text-color: #24292e;
      --keyword: #d73a49;
      --string: #e67e22; 
      --comment: #6a737d;
      --builtin: #005cc5;
      --line-num-bg: #f8f8f8;
      --line-num-text: #999;
      --accent-green: #28a745;
      --accent-red: #cb2431;
      --accent-blue: #0366d6;
    }

    body { font-family: -apple-system, system-ui, sans-serif; margin: 20px; background: #eee; color: #333; }
    h2 { margin-top: 0; font-weight: 600; }

    .editor-container {
      display: flex;
      position: relative;
      width: 100%;
      height: 450px;
      border: 1px solid #ddd;
      border-radius: 6px;
      background: var(--bg-color);
      overflow: hidden;
      box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    }

    .language-select {
      padding: 8px 12px;
      border: 1px solid #ccc;
      border-radius: 6px;
      background: white;
      font-size: 14px;
      cursor: pointer;
      transition: background 0.2s;
    }

    .language-select:hover {
      background: #f6f8fa;
    }

    .language-select:focus {
      outline: none;
      border-color: var(--accent-blue);
    }

    #line-numbers {
      width: 45px;
      padding: 15px 5px;
      background: var(--line-num-bg);
      color: var(--line-num-text);
      font-family: 'Fira Code', 'Courier New', monospace;
      font-size: 14px;
      line-height: 1.6;
      text-align: right;
      user-select: none;
      border-right: 1px solid #ddd;
      overflow: hidden;
    }

    .editor-wrapper {
      position: relative;
      flex-grow: 1;
      height: 100%;
    }

    #code, #highlighter {
      margin: 0;
      padding: 15px;
      font-family: 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
      font-size: 14px;
      line-height: 1.6;
      white-space: pre;
      word-wrap: normal;
      overflow-x: auto;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      box-sizing: border-box;
      outline: none;
      border: none;
    }

    #code {
      z-index: 2;
      background: transparent;
      color: transparent;
      caret-color: #333;
      resize: none;
    }

    #highlighter {
      z-index: 1;
      color: var(--text-color);
      pointer-events: none;
    }

    /* Syntax Highlighting */
    .hl-keyword { color: var(--keyword); font-weight: bold; }
    .hl-string  { color: var(--string); }
    .hl-comment { color: var(--comment); font-style: italic; }
    .hl-builtin { color: var(--builtin); }

    .controls { margin: 15px 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
    
    button { 
      padding: 8px 16px; 
      cursor: pointer; 
      border-radius: 4px; 
      border: 1px solid #ccc; 
      background: white; 
      font-size: 14px;
      font-weight: 500;
      transition: all 0.2s;
    }

    button:hover { background: #f0f0f0; }

    #runBtn { background: var(--accent-green); color: white; border-color: #218838; }
    #runBtn:hover { background: #218838; }
    #runBtn:disabled { background: #94d3a2; cursor: wait; }

    #stopBtn { color: var(--accent-red); border-color: #d1d1d1; }
    
    .btn-upload { color: var(--accent-blue); }

    .shortcut-hint { font-size: 12px; color: #888; margin-left: 2px; }
    .spacer { flex-grow: 1; }

    pre#output { 
      background: #1e1e1e; color: #f0f0f0; padding: 15px; border-radius: 6px; 
      min-height: 120px; max-height: 300px; overflow-y: auto; font-family: 'Courier New', monospace;
      border: 1px solid #333; line-height: 1.4;
    }

#problemPanel {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 20px;
}

#problemPanel h3,
#problemPanel h4 {
    margin-top: 18px;
    margin-bottom: 8px;
}

#problemPanel pre {
    background: #f6f8fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    white-space: pre-wrap;
    font-family: inherit;
}
