* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 95vh;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
    flex-shrink: 0;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.control-panel {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 2px solid #e9ecef;
    flex-shrink: 0;
}

.config-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-item label {
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-select, select {
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.language-select:hover, select:hover {
    border-color: #667eea;
}

.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    min-width: 140px;
}

.run-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.run-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.clear-btn {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
}

.input-btn {
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    min-width: auto;
}

.editor-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    height: 500px;
    flex-grow: 1;
    min-height: 0;
}

.code-editor, .output-panel {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.editor-header, .output-header {
    background: linear-gradient(135deg, #2c3e50 0%, #4a6491 100%);
    color: white;
    padding: 15px 20px;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#filename {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-family: 'Consolas', monospace;
}

.CodeMirror {
    flex-grow: 1;
    font-size: 14px;
    line-height: 1.5;
    border: none;
}

.CodeMirror-scroll {
    min-height: 100%;
}

.output-content {
    flex-grow: 1;
    padding: 20px;
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
}

#output {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

.console-controls {
    padding: 15px;
    background: #2d2d2d;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

#consoleInput {
    flex: 1;
    padding: 10px;
    background: #3e3e3e;
    border: 1px solid #555;
    color: white;
    border-radius: 5px;
    font-family: 'Consolas', monospace;
}

#consoleInput:focus {
    outline: none;
    border-color: #667eea;
}

.status {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.status.loading {
    background: #ff9800 !important;
}

.status.success {
    background: #4CAF50 !important;
}

.status.error {
    background: #f44336 !important;
}

.info-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-top: 2px solid #e9ecef;
    flex-shrink: 0;
}

.info-box, .stats-box {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.info-box h4, .stats-box h4 {
    color: #667eea;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer {
    text-align: center;
    padding: 20px;
    background: #2c3e50;
    color: white;
    flex-shrink: 0;
}

.footer a {
    color: #4fc3f7;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .editor-panel {
        grid-template-columns: 1fr;
        height: 700px;
    }
    
    .info-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .config-group {
        grid-template-columns: 1fr;
    }
    
    .buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.output-content::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.output-content::-webkit-scrollbar-thumb {
    background: #555;
}

.output-content::-webkit-scrollbar-thumb:hover {
    background: #666;
}