/* C++代码编辑器样式 - 简化版 */
.cpp-editor {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 工具栏 */
.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.editor-toolbar-left, .editor-toolbar-right {
    display: flex;
    align-items: center;
}

.editor-language {
    font-weight: 600;
    color: #3b82f6;
    display: flex;
    align-items: center;
}

.editor-language i {
    margin-right: 8px;
}

.editor-toolbar-right {
    display: flex;
    gap: 4px;
}

/* 按钮样式 */
.editor-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
}

.editor-btn:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

.editor-btn.active {
    background-color: #dbeafe;
    color: #2563eb;
}

/* 编辑器容器 */
.editor-container {
    position: relative;
    flex: 0 0 auto;
    min-height: 100px;
    height: 500px; /* 默认高度，会被JavaScript覆盖 */
}

.editor-textarea {
    width: 100%;
    height: 100%;
    padding: 12px;
    border: none;
    resize: none;
    font-family: Consolas, Monaco, "Andale Mono", monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #1f2937;
    background-color: #fff;
    outline: none;
}

.monaco-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

/* 加载指示器 */
.editor-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 12px;
    font-size: 14px;
    color: #4b5563;
}

/* 状态栏 */
.editor-statusbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
    color: #6b7280;
}

.editor-stats {
    display: flex;
    gap: 12px;
}

/* 全屏模式 */
.cpp-editor.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    border-radius: 0;
}

.cpp-editor.fullscreen .editor-container {
    height: calc(100vh - 90px) !important;
}

/* 深色主题 */
.cpp-editor.dark-theme {
    border-color: #374151;
    background-color: #1f2937;
}

.cpp-editor.dark-theme .editor-toolbar,
.cpp-editor.dark-theme .editor-statusbar {
    background-color: #111827;
    border-color: #374151;
    color: #9ca3af;
}

.cpp-editor.dark-theme .editor-btn {
    color: #9ca3af;
}

.cpp-editor.dark-theme .editor-btn:hover {
    background-color: #374151;
    color: #e5e7eb;
}

.cpp-editor.dark-theme .editor-textarea {
    background-color: #1f2937;
    color: #e5e7eb;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .editor-stats {
        flex-direction: column;
        gap: 4px;
    }
}
