body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --background: #f8f9fa;
    --card-bg: #ffffff;
    --card-bj: #355d7e;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #9b59b6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui;
}

body {
    background: var(--background);
    display: flex;
    font-family: 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
}

.sidebar {
    width: 130px;
    background: var(--card-bj);
    padding: 2rem 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
}

.sidebar ul {
    list-style-type: none;
}

.sidebar li {
    margin-bottom: 1.5rem;
    padding: 0.1rem 0.1rem;
    border-radius: 6px;
    transition: all 0.3s;
}

.sidebar li:hover {
    background: #f0f0f0;
}

.sidebar a {
    text-decoration: none;
    color: #f0ecec;
    font-weight: 500;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar a:hover {
    color: var(--primary-color);
}

.container {
    flex: 1;
    padding: 2rem;
    max-width: calc(100% - 130px);
}

.upload-section,
.student-track-section,
.report-module,
.chart-container,
.class-analysis-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.upload-section {
    padding: 3rem 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s;
}

.upload-section:hover {
    transform: translateY(-5px);
}

.upload-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.2rem 2.5rem;
    border-radius: 2rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.1rem;
    border: none;
    transition: all 0.3s;
}

.upload-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(67, 97, 238, 0.3);
}

#fileInput {
    display: none;
}

canvas {
    max-height: 500px;
    margin: 1rem 0;
}

h1,
h2 {
    color: #2b2d42;
    margin-bottom: 1.5rem;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.8rem;
}

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

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-message {
    background: #ff4444;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: none;
}

.filter-row,
.student-filter,
.subject-select,
.exam-filter,
.subject-filter,
.class-filter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.exam-filter select,
.subject-filter select,
.class-filter select,
.student-filter select,
.subject-select select {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #ccc;
    background: white;
    font-size: 1rem;
    min-width: 200px;
}

.exam-filter label,
.subject-filter label,
.class-filter label,
.student-filter label,
.subject-select label {
    margin-right: 0.5rem;
    font-weight: 500;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(236, 237, 238, 0);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0);
    min-width: 160px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #3498db;
}

.stat-icon {
    font-size: 1.2rem;
    margin-left: 0.5rem;
}

.class-analysis-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.class-analysis-title {
    font-size: 1.2rem;
    color: #444;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.class-stats-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed #ddd;
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem;
    }
    .container {
        max-width: 100%;
        padding: 1rem;
    }
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    .stat-item {
        min-width: 120px;
        padding: 0.8rem 1rem;
    }
}

.student-track-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.student-track-title {
    font-size: 1.2rem;
    color: #444;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.success-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: #4CAF50;
    color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
}

.report-module {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.export-buttons {
    margin: 1rem 0;
    display: flex;
    gap: 1rem;
}

#classScoreTable,
.score-distribution-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

#classScoreTable th,
#classScoreTable td,
.score-distribution-table th,
.score-distribution-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: center;
}

#classScoreTable th,
.score-distribution-table th {
    background-color: #ffffff;
    color: rgb(10, 10, 10);
}

@media print {
   .sidebar,
   .upload-section,
   .export-buttons {
        display: none !important;
    }
   .report-module {
        box-shadow: none;
        padding: 0;
    }
   .report-module table {
        width: 100% !important;
        font-size: 14pt;
    }
}

.export-btn,
.print-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

.export-btn {
    background-color: #007BFF;
    color: white;
}
.threshold-btn{
    background-color: #007BFF;
    color: white;
     padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}
.export-btn:hover {
    background-color: #0056b3;
}

.print-btn {
    background-color: #DC3545;
    color: white;
}

.print-btn:hover {
    background-color: #b02a37;
}

.info-box,
.info-box1 {
    padding: 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 1rem;
}

.info-box {
    background-color: #f0f9ff;
    border-left: 4px solid #0ea5e9;
}

.info-box1 {
    background-color: #f0f9ff;
    border-left: 4px solid #dfaf14;
}

.score-distribution-table {
    margin-top: 2rem;
    overflow-x: auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.score-distribution-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.score-distribution-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.radar-charts-container {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    flex-wrap: wrap;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0);
    padding: 1rem;
}

.radar-chart {
    width: 48%;
    min-width: 400px;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
   .radar-chart {
        width: 100%;
    }
}

#student-track {
    position: relative;
}

/* 修复阈值输入区域 */
.threshold-inputs {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.threshold-input {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 120px;
}

.threshold-input label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
    font-family: '宋体';
}

.threshold-input input {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    width: 120px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.threshold-input input:focus {
    border-color: #4361ee;
    outline: none;
    box-shadow: 0 0 5px rgba(67, 97, 238, 0.3);
}

/* 修复计算按钮 */
#calculateAdmission {
    padding: 12px 25px;
    background: linear-gradient(135deg, #4361ee, #3a56d4);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    margin-top: 10px;
}

#calculateAdmission:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4);
}

/* 确保上线结果表格正确显示 */
#admissionResults {
    margin-top: 25px;
    overflow-x: auto;
}

.admission-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.admission-table th {
    background: linear-gradient(135deg, #4361ee, #3a56d4);
    color: white;
    padding: 15px;
    font-weight: bold;
    font-size: 16px;
}

.admission-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.admission-table tr:hover {
    background-color: #f5f7ff;
}

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

/* 确保整个模块可见 */
#admission-analysis {
    position: relative;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 修复学科分数线设置表格 */
#subjectThresholdSettingsTable {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

#subjectThresholdSettingsTable th {
    background: #f8f9fa;
    padding: 12px;
    font-weight: bold;
    border-bottom: 2px solid #dee2e6;
}

#subjectThresholdSettingsTable td {
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
}

#subjectThresholdSettingsTable input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

#subjectThresholdSettingsTable input:focus {
    border-color: #4361ee;
    outline: none;
}

.admission-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.admission-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.admission-table tr:hover {
    background-color: #f1f1f1;
}

.total-row {
    font-weight: bold;
    background-color: #e6f7ff !important;
}

.progress-analysis {
    margin-top: 20px;
    padding: 20px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0);
}

.progress-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.progress-card {
    flex: 1;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

.full-width {
    flex: 0 0 100%;
}

.score-diff-table {
    width: 100%;
    border-collapse: collapse;
}

.score-diff-table th, 
.score-diff-table td {
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
}

.score-diff-table th {
    background-color: #f2f2f2;
}

.zscore-container {
    display: flex;
    gap: 20px;
}

.zscore-legend {
    min-width: 200px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
}

.improvement {
    color: #28a745;
}

.decline {
    color: #dc3545;
}
.alert {
    color: #dc3545;
    padding: 10px;
    background: #ffeeee;
    border-radius: 4px;
}

.zscore-table {
    width: 100%;
    border-collapse: collapse;
}

.zscore-table td {
    padding: 6px;
    border-bottom: 1px solid #eee;
}

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

.progress-analysis {
    margin-top: 20px;
}

.progress-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.progress-card {
    flex: 1;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.progress-card h4 {
    margin-top: 0;
    color: #4361ee;
    font-family: '宋体';
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.full-width {
    flex: 0 0 100%;
}

.score-diff-table {
    width: 100%;
    border-collapse: collapse;
}

.score-diff-table th, 
.score-diff-table td {
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
}

.score-diff-table th {
    background-color: #f5f5f5;
    font-family: '宋体';
}

.positive {
    color: #4CAF50;
    font-weight: bold;
}

.negative {
    color: #F44336;
    font-weight: bold;
}

.neutral {
    color: #666;
}

.zscore-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* 添加这一行使图例可以换行 */
    align-items: flex-start; /* 顶部对齐 */
}

.zscore-legend {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* 顶部对齐 */
    gap: 8px;
    min-width: 150px; /* 设置最小宽度 */
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-left: 20px;
}

#zScoreChart {
    flex: 1;
    min-width: 300px; /* 设置图表最小宽度 */
}

.legend-color {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    border-radius: 4px;
    flex-shrink: 0; /* 防止颜色块被压缩 */
}

/* 梯队分布容器 */
.tier-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.tier-chart {
    flex: 1;
    min-width: 300px;
}

.tier-table {
    flex: 1;
    overflow-x: auto;
}

.tier-table table {
    width: 100%;
    border-collapse: collapse;
}

.tier-table th, .tier-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: center;
    font-family: '宋体';
}

.tier-table th {
    background-color: #f5f5f5;
}

/* 学科贡献度表格 */
#subjectContributionTable {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

#subjectContributionTable th, 
#subjectContributionTable td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: center;
    font-family: '宋体';
}

#subjectContributionTable th {
    background-color: #f5f5f5;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

/* 图表容器 */
#classBiasChart, #dynamicTrendChart {
    margin-bottom: 30px;
    max-height: 400px;
}
/* 家长视图报告样式 */
.parent-view-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.report-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
}

.report-btn {
    padding: 10px 20px;
    background-color: #4361ee;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: '宋体';
    font-size: 14px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-btn:hover {
    background-color: #3a56d4;
}

.parent-report {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.report-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #4361ee;
    padding-bottom: 15px;
}

.report-header h2 {
    color: #4361ee;
    font-family: '隶书';
    margin-bottom: 5px;
}

.report-meta {
    display: flex;
    justify-content: space-between;
    font-family: '宋体';
    color: #666;
    font-size: 14px;
}

.report-section {
    margin-bottom: 25px;
}

.report-section h3 {
    color: #4361ee;
    font-family: '隶书';
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.comments-box {
    background-color: #f5f7ff;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #4361ee;
    font-family: '宋体';
    line-height: 1.6;
}

#subjectPerformanceTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-family: '宋体';
}

#subjectPerformanceTable th, 
#subjectPerformanceTable td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}

#subjectPerformanceTable th {
    background-color: #f0f4ff;
    color: #4361ee;
}

#subjectPerformanceTable tr:nth-child(even) {
    background-color: #f9f9f9;
}

.charts-section {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.chart-container {
    flex: 1;
    min-width: 300px;
}

.comments-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: '宋体';
    resize: vertical;
}

.report-footer {
    margin-top: 30px;
    font-family: '宋体';
}

.print-only {
    display: none;
}

/* 确保所有图表在PDF中可见 */
canvas {
    max-width: 100% !important;
    height: auto !important;
}

/* 解决PDF中的字体问题 */
body {
    font-family: 'Microsoft YaHei', 'SimHei', sans-serif;
}

/* 确保PDF导出内容可见 */
#parentReport {
    background-color: white !important;
    color: black !important;
}

/* 处理图表容器 */
.chart-container {
    page-break-inside: avoid;
    break-inside: avoid;
}

/* 打印时隐藏不需要的元素 */
@media print {
    body * {
        visibility: hidden;
    }
    #parentReport, #parentReport * {
        visibility: visible;
    }
    #parentReport {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }
}
.system-info {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    line-height: 1.6;
}
.system-info ol {
    padding-left: 20px;
}
.system-info li {
    margin-bottom: 8px;
}
/* 确保PDF导出时内容完整显示 */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    #parentReport {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
    
    .parent-report {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .print-only {
        display: block !important;
    }
    
    /* 隐藏不需要打印的元素 */
    .sidebar, .upload-section, .export-buttons, .report-controls {
        display: none !important;
    }
    
    /* 确保图表容器在PDF中正确显示 */
    .chart-container {
        page-break-inside: avoid;
        width: 100% !important;
        height: auto !important;
    }
    
    /* 处理图片在PDF中的显示 */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
}
#class-report {
            overflow-x: auto;
            white-space: nowrap;
        }
        /* 分数线表格样式 */
        .threshold-table {
            border-collapse: collapse;
            width: 100%;
        }
        .threshold-table th, .threshold-table td {
            border: 1px solid #ddd;
            padding: 8px;
            text-align: left;
        }
     /* 分数线设置表格样式 */
.threshold-settings {
    margin: 20px 0;
    overflow-x: auto;
    width: 100%;
}

#thresholdSettingsTable {
    width: 100%;
    min-width: 800px; /* 确保表格有最小宽度 */
    border-collapse: collapse;
    margin-bottom: 15px;
}

#thresholdSettingsTable th, 
#thresholdSettingsTable td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
    font-family: '宋体';
    white-space: nowrap; /* 防止文字换行 */
}

#thresholdSettingsTable th {
    background-color: #f5f5f5;
    font-weight: bold;
}

#thresholdSettingsTable input.threshold-input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-family: '宋体';
    font-size: 14px;
}

#thresholdSettingsTable input.threshold-input:focus {
    border-color: #4361ee;
    outline: none;
    box-shadow: 0 0 5px rgba(67, 97, 238, 0.3);
}

/* 报表水平滚动条样式 */
.report-module {
    overflow-x: auto;
    width: 100%;
    margin-bottom: 30px;
}

#classScoreTable {
    min-width: 100%;
    border-collapse: collapse;
}

#classScoreTable th, 
#classScoreTable td {
    padding: 10px 15px;
    border: 1px solid #ddd;
    text-align: center;
    white-space: nowrap;
}

#classScoreTable th {
    background-color: #f5f5f5;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* 滚动条样式 */
.report-module::-webkit-scrollbar {
    height: 8px;
}

.report-module::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.report-module::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.report-module::-webkit-scrollbar-thumb:hover {
    background: #555;
}