/* Rust Quiz 统一样式文件 */

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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #CE422B, #F74C00);
    color: white;
    padding: 40px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.quiz-info {
    background: #f8f9fa;
    padding: 20px;
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.info-item {
    flex: 1;
}

.info-item .number {
    font-size: 2em;
    font-weight: bold;
    color: #CE422B;
}

.info-item .label {
    color: #666;
    margin-top: 5px;
}

.content {
    padding: 40px;
}

.question {
    margin-bottom: 40px;
    padding: 30px;
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.question:hover {
    border-color: #CE422B;
    box-shadow: 0 8px 25px rgba(206, 66, 43, 0.15);
}

.question-number {
    background: linear-gradient(135deg, #CE422B, #F74C00);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    font-weight: bold;
    font-size: 1em;
    margin-bottom: 15px;
    white-space: nowrap;
}

.question-text {
    font-size: 1.2em;
    margin-bottom: 20px;
    line-height: 1.6;
    color: #333;
}

.options {
    display: grid;
    gap: 10px;
}

.option {
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.option:hover {
    border-color: #CE422B;
    background: #fff5f5;
}

.option.selected {
    border-color: #CE422B;
    background: #CE422B;
    color: white;
}

.option.correct {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

.option.incorrect {
    border-color: #ef4444;
    background: #ef4444;
    color: white;
}

.text-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: #CE422B;
}

.explanation {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #CE422B;
    display: none;
}

.explanation h4 {
    color: #CE422B;
    margin-bottom: 10px;
}

.explanation p {
    margin-bottom: 8px;
    line-height: 1.6;
}

.code-block {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    margin: 10px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.4;
    overflow-x: auto;
}

.btn {
    background: linear-gradient(135deg, #CE422B, #F74C00);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    font-weight: 600;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(206, 66, 43, 0.4);
}

.text-center {
    text-align: center;
    margin-top: 40px;
}

.final-results {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 15px;
    margin-top: 30px;
    display: none;
}

.result-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.result-text {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.result-score {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 20px;
}

/* 兼容旧版样式 */
.answer {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 15px;
    margin-top: 15px;
    border-radius: 6px;
    display: none;
}

.answer.show {
    display: block;
}

.answer h4 {
    color: #155724;
    margin-top: 0;
}

.controls {
    text-align: center;
    margin: 30px 0;
}

.score {
    background: #cce5ff;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    margin: 20px 0;
    display: none;
}

.textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
}

.highlight {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }

    .header {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 2em;
    }

    .content {
        padding: 20px;
    }

    .question {
        padding: 20px;
    }

    .quiz-info {
        flex-direction: column;
        gap: 15px;
    }

    .info-item {
        flex: none;
    }
}