/* 全国青少年人工智能大赛模拟考试系统样式表 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.header .logo img {
    height: 50px;
}

.header .logo h1 {
    font-size: 24px;
    font-weight: 600;
    background: linear-gradient(90deg, #00d4ff, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header .nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header .nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.header .nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header .nav .btn-logout {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
}

/* 主内容区 */
.main-content {
    padding: 30px 0;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-header h2 {
    color: #1a1a2e;
    font-size: 22px;
    font-weight: 600;
}

.card-header p {
    color: #666;
    margin-top: 5px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control.error {
    border-color: #ff6b6b;
}

.error-message {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 5px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 登录/注册页面 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px);
}

.auth-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 100%;
    max-width: 450px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #1a1a2e;
    font-size: 28px;
}

.auth-card .logo-icon {
    text-align: center;
    margin-bottom: 20px;
}

.auth-card .logo-icon img {
    height: 80px;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* 赛道选择 */
.track-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.track-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 16px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.track-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

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

.track-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.track-card p {
    font-size: 14px;
    opacity: 0.8;
}

/* 学段选择 */
.grade-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.grade-btn {
    padding: 15px 30px;
    border: 2px solid #667eea;
    border-radius: 10px;
    background: white;
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.grade-btn:hover {
    background: #667eea;
    color: white;
}

.grade-btn.selected {
    background: #667eea;
    color: white;
}

.grade-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ccc;
    color: #ccc;
}

/* 试卷列表 */
.paper-list {
    display: grid;
    gap: 15px;
}

.paper-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.paper-item:hover {
    background: #e9ecef;
}

.paper-item.completed {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.paper-item .paper-info h4 {
    color: #1a1a2e;
    margin-bottom: 5px;
}

.paper-item .paper-info p {
    color: #666;
    font-size: 14px;
}

.paper-item .status-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.status-badge.completed {
    background: #28a745;
    color: white;
}

.status-badge.pending {
    background: #ffc107;
    color: #333;
}

/* 考试页面 */
.exam-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exam-header h2 {
    font-size: 20px;
}

.exam-timer {
    font-size: 24px;
    font-weight: bold;
    color: #00d4ff;
}

/* 题目样式 */
.question-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.question-section h3 {
    color: #667eea;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.question-item {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.question-item .question-number {
    display: inline-block;
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    margin-right: 10px;
    font-weight: bold;
}

.question-item .question-text {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.question-item .options {
    margin-left: 40px;
}

.question-item .option {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.question-item .option:hover {
    background: #e9ecef;
}

.question-item .option.selected {
    background: #d4e5ff;
    border: 1px solid #667eea;
}

.question-item .option.correct {
    background: #d4edda;
    border: 1px solid #28a745;
}

.question-item .option.wrong {
    background: #f8d7da;
    border: 1px solid #dc3545;
}

.question-item .option input {
    margin-right: 10px;
    margin-top: 4px;
}

.question-item .option label {
    cursor: pointer;
    flex: 1;
}

/* 主观题样式 */
.subjective-question {
    margin-bottom: 25px;
    padding: 20px;
    background: #fff3cd;
    border-radius: 10px;
    border-left: 4px solid #ffc107;
}

.subjective-question textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    resize: vertical;
    margin-top: 15px;
}

.subjective-question .word-count {
    text-align: right;
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

/* 答题结果行 - 每道题下方显示 */
.question-result-row {
    margin-top: 12px;
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 15px;
    font-weight: 600;
}

.question-item.result-correct .question-result-row {
    background: #e8f5e9;
    border-left: 4px solid #28a745;
}

.question-item.result-incorrect .question-result-row {
    background: #fff5f5;
    border-left: 4px solid #dc3545;
}

.result-correct-text {
    color: #28a745;
    font-size: 16px;
    font-weight: 700;
}

.result-incorrect-text {
    color: #dc3545;
    font-size: 16px;
    font-weight: 700;
}

.result-correct-answer {
    color: #e53935;
    font-weight: 600;
    font-size: 15px;
}

.question-explanation {
    margin-top: 8px;
    padding: 10px 15px;
    background: #f0f4ff;
    border-radius: 8px;
    color: #444;
    font-size: 14px;
    line-height: 1.8;
}

.question-explanation strong {
    color: #667eea;
}

/* 题目结果边框样式 */
.question-item.result-correct {
    border-left: 4px solid #28a745;
    background: #f8fff8;
}

.question-item.result-incorrect {
    border-left: 4px solid #dc3545;
    background: #fff8f8;
}

/* 答题结果汇总 */
.result-summary {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
}

.result-summary-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
}

.result-summary-score {
    font-size: 18px;
    margin-bottom: 8px;
}

.result-summary-score .score-value {
    font-size: 36px;
    font-weight: 800;
    color: #00d4ff;
    margin: 0 5px;
}

.result-summary-score .score-total {
    font-size: 18px;
    color: #aaa;
}

.result-summary-note {
    font-size: 13px;
    color: #999;
}

/* 选项正确/错误高亮 */
.option-label.correct-answer {
    background: #d4edda !important;
    border: 2px solid #28a745;
    border-radius: 8px;
}

.option-label.wrong-answer {
    background: #f8d7da !important;
    border: 2px solid #dc3545;
    border-radius: 8px;
    text-decoration: line-through;
}

/* 答案显示 */
.answer-section {
    margin-top: 20px;
    padding: 20px;
    background: #e8f5e9;
    border-radius: 10px;
}

.answer-section.show {
    display: block;
}

.answer-section h4 {
    color: #2e7d32;
    margin-bottom: 15px;
}

.answer-item {
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.answer-item .correct-answer {
    color: #28a745;
    font-weight: bold;
}

.answer-item .user-answer {
    color: #666;
}

.answer-item .user-answer.wrong {
    color: #dc3545;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #1a1a2e;
}

.modal-content p {
    margin-bottom: 25px;
    color: #666;
}

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

/* 完成提示 */
.completion-message {
    text-align: center;
    padding: 40px;
}

.completion-message .icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.completion-message h3 {
    font-size: 24px;
    color: #28a745;
    margin-bottom: 15px;
}

.completion-message p {
    color: #666;
    margin-bottom: 25px;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-bar .progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 5px;
    transition: width 0.3s ease;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    color: white;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: white;
}

.breadcrumb span {
    color: rgba(255, 255, 255, 0.6);
}

/* 用户信息卡片 */
.user-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.user-info-card h3 {
    margin-bottom: 10px;
}

.user-info-card p {
    opacity: 0.9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .header .logo h1 {
        font-size: 18px;
    }
    
    .track-grid {
        grid-template-columns: 1fr;
    }
    
    .grade-buttons {
        flex-direction: column;
    }
    
    .grade-btn {
        width: 100%;
    }
    
    .paper-item {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .exam-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 提示消息 */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}
