/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.navbar {
    background-color: #0078d4;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-nav {
    display: flex;
    gap: 1rem;
}

.nav-item {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-primary {
    background-color: #0078d4;
    color: white;
}

.btn-primary:hover {
    background-color: #005a9e;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #c8c8c8;
}

.btn-secondary.active {
    background-color: #0078d4;
    color: white;
}

/* 主内容区 */
main {
    padding: 2rem 0;
}

/* 题目流样式 */
.question-feed {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 题目卡片样式 */
.question-card {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.question-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.question-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.question-meta {
    font-size: 0.875rem;
    color: #666;
}

.question-content {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.question-actions {
    display: flex;
    gap: 1rem;
}

/* 题目详情样式 */
.question-detail {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 答案表单样式 */
.answer-form {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.answer-form h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: #333;
}

.answer-type-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.answer-input {
    display: none;
    margin-bottom: 1.5rem;
}

.answer-input.active {
    display: block;
}

.answer-input textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
}

.voice-recorder {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.record-status {
    font-size: 0.875rem;
    color: #666;
}

.image-uploader {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.image-preview {
    width: 100%;
    max-width: 400px;
    height: 200px;
    border: 1px dashed #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 上传表单样式 */
.upload-form {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.upload-form h1 {
    margin-bottom: 2rem;
    font-size: 1.5rem;
    color: #333;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* 题目列表样式 */
.questions-list h1 {
    margin-bottom: 2rem;
    font-size: 1.5rem;
    color: #333;
    text-align: center;
}

.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.page-info {
    font-size: 0.875rem;
    color: #666;
}

/* 结果反馈样式 */
.result-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-card {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
}

.result-status {
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.result-status.correct {
    background-color: #d4edda;
    color: #155724;
}

.result-status.incorrect {
    background-color: #f8d7da;
    color: #721c24;
}

.result-status h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.result-question {
    margin-bottom: 1.5rem;
}

.result-question h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #333;
}

.result-answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.answer-section h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #666;
}

.user-answer,
.correct-answer {
    padding: 1rem;
    border-radius: 4px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
}

.correct-answer {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.result-feedback {
    margin-bottom: 1.5rem;
}

.result-feedback h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #666;
}

.feedback-content {
    padding: 1rem;
    border-radius: 4px;
    background-color: #e7f3ff;
    border: 1px solid #b3d7ff;
    color: #004085;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* 错误信息样式 */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border: 1px solid #f5c6cb;
}

/* 页脚样式 */
.footer {
    background-color: #333;
    color: white;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar-nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .question-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .questions-grid {
        grid-template-columns: 1fr;
    }
    
    .result-answers {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}
