/* 编辑器页面样式 */
.editor-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-selector label {
    font-weight: 500;
    color: #333;
}

.language-selector select {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s;
}

.language-selector select:focus {
    border-color: #667eea;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

.btn-clear, .btn-run {
    padding: 10px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-clear {
    background: #f5f5f5;
    color: #666;
}

.btn-clear:hover {
    background: #e0e0e0;
}

.btn-run {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-run:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.editor-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.code-editor, .output-area {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.editor-title, .output-title {
    padding: 15px 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 500;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#codeInput {
    width: 100%;
    height: 500px;
    padding: 20px;
    border: none;
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    background: #282c34;
    color: #abb2bf;
}

#codeInput::placeholder {
    color: #5c6370;
}

.output-frame {
    height: 300px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

#resultFrame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.console-output {
    padding: 15px;
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    max-height: 200px;
    overflow-y: auto;
}

.console-title {
    color: #4ec9b0;
    margin-bottom: 10px;
    font-weight: 500;
}

#consoleLog {
    line-height: 1.6;
}

#consoleLog .log-item {
    padding: 5px 0;
    border-bottom: 1px solid #333;
}

#consoleLog .log-item:last-child {
    border-bottom: none;
}

#consoleLog .error {
    color: #f48771;
}

#consoleLog .warn {
    color: #dcdcaa;
}

.btn-small {
    padding: 5px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.btn-small:hover {
    background: #764ba2;
}

/* 代码示例 */
.code-examples {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.code-examples h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.example-card {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.example-card:hover {
    background: #f0f4ff;
    border-color: #667eea;
    transform: translateY(-2px);
}

.example-card h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #333;
}

.example-card p {
    font-size: 14px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .editor-main {
        grid-template-columns: 1fr;
    }

    #codeInput {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .editor-header {
        flex-direction: column;
        gap: 15px;
    }

    .editor-actions {
        width: 100%;
    }

    .btn-clear, .btn-run {
        flex: 1;
    }
}
