/* 全局样式 */
body {
    font-family: 'Microsoft YaHei', 'SimHei', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #2c3e50;
    color: #ecf0f1;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: #34495e;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

h1 {
    text-align: center;
    color: #ecf0f1;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* 代码字体选项 */
.code-font-options {
    margin-bottom: 15px;
    padding: 15px;
    background: #2c3e50;
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.code-font-options label {
    display: flex;
    align-items: center;
    margin-right: 15px;
    font-weight: bold;
}

.code-font-options select {
    margin-left: 5px;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #7f8c8d;
    background: #ecf0f1;
    color: #2c3e50;
}

/* 代码表单 */
.code-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #ecf0f1;
}

select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #7f8c8d;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
    background: #2c3e50;
    color: #ecf0f1;
}

textarea {
    font-family: 'Courier New', monospace;
}

/* 编辑器头部 */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.fullscreen-btn {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 16px;
}

.fullscreen-btn:hover {
    background: #2980b9;
}

/* 代码编辑器容器 */
.code-editor-container {
    position: relative;
}

/* 全屏模式 */
.CodeMirror-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: auto;
    z-index: 1000;
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

button {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    flex: 1;
    transition: background 0.3s;
    font-weight: bold;
}

button:hover {
    background: #2ecc71;
}

button#stop-btn {
    background: #e74c3c;
}

button#stop-btn:hover {
    background: #c9302c;
}

button#clear-btn {
    background: #f39c12;
}

button#clear-btn:hover {
    background: #e67e22;
}

/* 代码编辑器样式 */
.CodeMirror {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    height: auto;
    min-height: 300px;
    border: 1px solid #7f8c8d;
    border-radius: 6px;
    background: #2c3e50;
    color: #ecf0f1;
}

.CodeMirror-gutters {
    background: #2c3e50;
    border-right: 1px solid #7f8c8d;
}

/* 等宽字体选项 */
.font-monospace {
    font-family: 'Courier New', Courier, monospace;
}

.font-consolas {
    font-family: Consolas, monospace;
}

.font-source-code {
    font-family: 'Source Code Pro', monospace;
}

/* 输出容器 */
.output-container {
    margin-top: 20px;
}

.output-container h2 {
    margin-bottom: 10px;
    color: #ecf0f1;
}

/* 终端样式 */
.terminal {
    background: #1e272e;
    border: 1px solid #7f8c8d;
    border-radius: 6px;
    padding: 15px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    color: #ecf0f1;
}

#output-content {
    white-space: pre-wrap;
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* 执行时间显示 */
.execution-time {
    margin-top: 10px;
    font-style: italic;
    color: #bdc3c7;
}

/* 滚动条样式 */
.terminal::-webkit-scrollbar {
    width: 8px;
}

.terminal::-webkit-scrollbar-track {
    background: #2c3e50;
    border-radius: 4px;
}

.terminal::-webkit-scrollbar-thumb {
    background: #7f8c8d;
    border-radius: 4px;
}

.terminal::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* 全屏模式下的覆盖样式 */
body.fullscreen-mode {
    overflow: hidden;
}

body.fullscreen-mode .container {
    display: none;
}

body.fullscreen-mode .CodeMirror-fullscreen {
    display: block;
}