* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1800px;
    margin: 0 auto;
}

header {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.difficulty-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
}

.difficulty-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.difficulty-input {
    width: 60px;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    background-color: white;
    color: #333;
    font-weight: 600;
    text-align: center;
}

.difficulty-input:focus {
    outline: 2px solid #3949ab;
}

.status-bar {
    display: flex;
    gap: 25px;
    align-items: center;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.status-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

.status-value {
    font-size: 1.2rem;
    font-weight: 600;
}

.warning-badge {
    background-color: #ff5252;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    display: none;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 82, 82, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0); }
}

.main-content {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 20px;
    overflow: hidden;
    min-height: 0;
}

.problem-section {
    flex: 1;
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.problem-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.problem-title {
    font-size: 1.6rem;
    color: #1a237e;
    margin-bottom: 0;
}

.problem-desc {
    margin-bottom: 25px;
}

.section-title {
    font-size: 1.2rem;
    color: #3949ab;
    margin: 20px 0 10px 0;
}

.code-section {
    flex: 2;
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background-color: #1a237e;
    color: white;
}

.code-header h3 {
    font-size: 1.3rem;
}

.language-selector {
    background-color: #283593;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 600;
}

.code-editor {
    flex: 1;
    overflow: hidden;
}

.CodeMirror {
    height: 100% !important;
    font-size: 16px;
}

.actions-section {
    display: flex;
    gap: 15px;
    padding: 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-primary {
    background-color: #3949ab;
    color: white;
}

.btn-primary:hover {
    background-color: #303f9f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: #e8eaf6;
    color: #3949ab;
}

.btn-secondary:hover {
    background-color: #c5cae9;
}

.btn-danger {
    background-color: #ff5252;
    color: white;
}

.btn-danger:hover {
    background-color: #ff1744;
}

.btn-success {
    background-color: #4caf50;
    color: white;
}

.btn-success:hover {
    background-color: #388e3c;
}

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

.btn-ai:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 全屏提示样式 */
.fullscreen-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    text-align: center;
    padding: 20px;
}

.fullscreen-prompt h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: white;
}

.fullscreen-prompt p {
    font-size: 1.2rem;
    max-width: 800px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.fullscreen-prompt .btn {
    font-size: 1.2rem;
    padding: 15px 40px;
    margin-top: 20px;
}

.fullscreen-prompt .warning {
    color: #ff5252;
    font-weight: bold;
    margin-top: 20px;
    font-size: 1.1rem;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 1.5rem;
    color: #1a237e;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: #3949ab;
    box-shadow: 0 0 0 2px rgba(57, 73, 171, 0.2);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.test-case {
    margin-bottom: 15px;
    padding: 15px;
    background-color: white;
    border-radius: 6px;
    border-left: 4px solid #e8eaf6;
}

.test-case.passed {
    border-left-color: #4caf50;
}

.test-case.failed {
    border-left-color: #ff5252;
}

.test-case-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.test-case-title {
    font-weight: 600;
}

.test-case-status {
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
}

.status-passed {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-failed {
    background-color: #ffebee;
    color: #c62828;
}

.test-case-details {
    font-family: monospace;
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.problem-list {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.problem-list h4 {
    color: #3949ab;
    margin-bottom: 15px;
}

.problem-list-item {
    padding: 10px 15px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-left: 4px solid #e8eaf6;
}

.problem-list-item:hover {
    background-color: #e8eaf6;
}

.problem-list-item.active {
    background-color: #e8eaf6;
    border-left-color: #3949ab;
}

.problem-list-item.ai-generated {
    border-left-color: #764ba2;
}

.problem-list-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.problem-list-desc {
    font-size: 0.9rem;
    color: #666;
}

.ai-tag {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3949ab;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.difficulty-display {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.9rem;
    background-color: #e8eaf6;
    padding: 2px 8px;
    border-radius: 10px;
    color: #3949ab;
}

.difficulty-1 { background-color: #e8f5e9; color: #2e7d32; }
.difficulty-2 { background-color: #f1f8e9; color: #558b2f; }
.difficulty-3 { background-color: #f9fbe7; color: #9e9d24; }
.difficulty-4 { background-color: #fffde7; color: #f9a825; }
.difficulty-5 { background-color: #fff3e0; color: #ef6c00; }
.difficulty-6 { background-color: #fbe9e7; color: #d84315; }
.difficulty-7 { background-color: #ffebee; color: #c62828; }
.difficulty-8 { background-color: #fce4ec; color: #ad1457; }
.difficulty-9 { background-color: #f3e5f5; color: #6a1b9a; }
.difficulty-10 { background-color: #e8eaf6; color: #283593; }

footer {
    text-align: center;
    padding: 15px;
    background-color: #e8eaf6;
    color: #5c6bc0;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* 违规记录样式 */
.violation-badge {
    background-color: #ff5252;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
    margin-left: 10px;
}

@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }

    .problem-section, .code-section {
        width: 100%;
    }

    .header-controls {
        flex-direction: column;
        align-items: flex-end;
        gap: 10px;
    }
}