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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

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

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主内容区域 */
.main-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 30px;
}

/* 章节样式 */
.section {
    display: none;
}

.section.active {
    display: block;
}

.section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.8rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* 必选标记 */
.required {
    color: #dc3545;
    font-weight: bold;
}

/* 表单区块样式 */
.form-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.section-hint {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-style: italic;
}

/* 表单行样式 */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-row:last-child {
    margin-bottom: 0;
}

/* 表单组样式 */
.form-group {
    margin-bottom: 20px;
    flex: 1;
    min-width: 250px;
}

.form-group.half {
    flex: 0 0 calc(50% - 10px);
    min-width: 250px;
}

.form-group.full {
    flex: 0 0 100%;
}

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

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

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

/* 错题项样式 */
.mistakes-container {
    margin-bottom: 20px;
}

.mistake-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.mistake-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-color: #667eea;
}

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

.mistake-header h4 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin: 0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 4px;
}

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

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* 上传区域样式 */
.upload-area {
    background: #f8f9fa;
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #667eea;
    background: #eef2ff;
}

.upload-area input[type="file"] {
    margin-bottom: 10px;
}

.upload-hint {
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 10px;
}

.upload-preview {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.upload-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    background: white;
}

.upload-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview-item .remove-file {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 提交区域样式 */
.submit-section {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.mistake-field label {
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #666;
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

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

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

/* 加载状态样式 */
.loading {
    text-align: center;
    padding: 50px 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* 分析结果样式 */
.analysis-result {
    margin: 30px 0;
}

.result-card {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 6px;
}

.result-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.result-card p {
    margin-bottom: 10px;
    color: #555;
}

.result-card ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.result-card li {
    margin-bottom: 8px;
    color: #555;
}

/* 图表容器 */
.chart-container {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
}

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

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

    .main-content {
        padding: 20px;
    }

    .mistake-row {
        flex-direction: column;
        gap: 15px;
    }

    .mistake-field {
        min-width: 100%;
    }

    .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .form-actions {
        display: flex;
        flex-direction: column;
    }
}

/* 卡片式布局 */
.report-section {
    margin-bottom: 30px;
}

.report-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: #667eea;
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 8px;
    margin-bottom: 8px;
}

/* 帮助信息样式 */
.help-section {
    background: #e3f2fd;
    border-color: #bbdefb;
}

.help-content {
    margin-top: 20px;
}

.help-item {
    margin-bottom: 25px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.help-item h4 {
    color: #2196f3;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.help-item h5 {
    color: #1976d2;
    margin: 15px 0 10px;
    font-size: 1rem;
}

.example {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
}

.example ul {
    margin-left: 20px;
    margin-top: 10px;
}

.example li {
    margin-bottom: 5px;
    color: #555;
}

/* 示例表格样式 */
.example-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.example-table th,
.example-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.example-table th {
    background: #f0f8ff;
    color: #1976d2;
    font-weight: 600;
}

.example-table tr:nth-child(even) {
    background: #fafafa;
}

.example-table tr:hover {
    background: #f5f5f5;
}

/* 错题帮助信息样式 */
.mistake-help {
    background: #f0f8ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2196f3;
}

.mistake-help h4 {
    color: #1976d2;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* 表格样式 */
.table-container {
    margin: 20px 0;
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.questions-table, .students-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.questions-table th, .students-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
}

.questions-table td, .students-table td {
    padding: 8px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.questions-table tr:hover, .students-table tr:hover {
    background-color: #f8f9fa;
}

.questions-table input, .students-table input,
.questions-table select, .students-table select,
.questions-table textarea, .students-table textarea {
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.questions-table textarea, .students-table textarea {
    resize: vertical;
    min-height: 40px;
}

.table-actions {
    padding: 15px;
    text-align: right;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 8px 8px;
}

/* 表单组四分之一宽度 */
.form-group.quarter {
    flex: 0 0 calc(25% - 15px);
    min-width: 150px;
}

/* 响应式表格 */
@media (max-width: 768px) {
    .table-container {
        overflow-x: scroll;
    }
    
    .questions-table, .students-table {
        font-size: 0.85rem;
    }
    
    .questions-table th, .students-table th,
    .questions-table td, .students-table td {
        padding: 6px 4px;
    }
    
    .form-group.quarter {
        flex: 0 0 100%;
        margin-right: 0;
    }
}

/* 进度条样式 */
.progress-container {
    margin: 20px 0;
}

.progress-item {
    margin-bottom: 15px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.95rem;
    font-weight: 600;
}

.progress-bar {
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

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

/* 评分样式 */
.score-display {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    margin: 20px 0;
}

.score-value {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 10px;
}

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

/* 错误提示样式 */
.error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

.form-control.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* 成功提示样式 */
.success-message {
    color: #28a745;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.success-message.show {
    display: block;
}

.form-control.success {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Toast通知样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: #dc3545;
}

.toast.success {
    background: #28a745;
}

.toast.info {
    background: #17a2b8;
}

/* 其他选项输入框样式 */
.other-input {
    margin-top: 10px;
    display: none;
}

.other-input.show {
    display: block;
}

/* 分析报告表格样式 */
.analysis-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.analysis-table th,
.analysis-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.analysis-table th {
    background: #f5f5f5;
    color: #333;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.analysis-table tr:nth-child(even) {
    background: #fafafa;
}

.analysis-table tr:hover {
    background: #f0f0f0;
    transition: background-color 0.2s ease;
}

.analysis-table td {
    color: #555;
}

.analysis-table tr:last-child td {
    border-bottom: none;
}

/* 标题样式调整 */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin: 20px 0 10px;
    font-weight: 600;
    color: #2c3e50;
}

.markdown-content h1 {
    font-size: 2rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.markdown-content h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 8px;
}

.markdown-content h3 {
    font-size: 1.25rem;
}

.markdown-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #555;
}

.markdown-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.markdown-content li {
    margin-bottom: 8px;
    color: #555;
    line-height: 1.5;
}