/* 数据分析模块样式 */

/* 文件选择 */
.file-selection {
    margin-bottom: 2rem;
}

/* 选择框样式 */
.select-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: white;
    transition: border-color 0.3s ease;
}

.select-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.select-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* 分析类型选择 - 下拉框样式 */
.analysis-type-selection {
    margin: 1.5rem 0 2.5rem;
    display: flex;
    justify-content: center;
}

.analysis-type-dropdown {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.analysis-type-dropdown label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    text-align: left;
}

/* 分析选项区域 */
.analysis-options {
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    background-color: rgba(248, 249, 250, 0.5);
}

.options-row {
    display: flex;
    gap: 2rem;
}

.options-column {
    flex: 1;
    min-width: 0;
}

.options-column h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-color);
}

/* 文件选择列表 */
.file-select-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: white;
}

.checkbox-list {
    padding: 0.5rem;
}

.checkbox-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.checkbox-item:last-child {
    border-bottom: none;
}

.checkbox-item label {
    margin-left: 0.5rem;
    cursor: pointer;
    flex: 1;
}

.checkbox-item input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* 科目选择 */
.subject-select-container {
    margin-top: 0.5rem;
}

/* 分析按钮 */
.analysis-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.analysis-actions .btn {
    min-width: 150px;
}

.analysis-actions .btn:disabled {
    background-color: var(--secondary-color);
    opacity: 0.7;
    cursor: not-allowed;
}

/* 分析结果区域 */
.analysis-result {
    margin-top: 2rem;
    min-height: 300px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    background-color: rgba(248, 249, 250, 0.5);
}

.empty-analysis {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 200px;
    color: var(--secondary-color);
    text-align: center;
    padding: 1rem;
}

.empty-analysis p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.analysis-steps {
    text-align: left;
    margin: 0 auto;
    max-width: 500px;
    padding-left: 2rem;
}

.analysis-steps li {
    margin-bottom: 0.8rem;
    color: var(--text-color);
    line-height: 1.5;
}

/* 学生选择区域 */
.student-selection {
    margin-top: 2rem;
    display: none; /* 初始隐藏，仅在需要时显示 */
}

/* 数据可视化区域 */
.chart-container {
    width: 100%;
    height: 500px;
    margin-top: 1.5rem;
    position: relative;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .analysis-type-dropdown {
        max-width: 100%;
    }
    
    .options-row {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .options-column {
        width: 100%;
    }
}

/* 自定义下拉框 */
.custom-dropdown {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.dropdown-selected {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dropdown-selected:hover {
    border-color: var(--primary-color);
}

.dropdown-arrow {
    color: var(--secondary-color);
    transition: transform 0.3s ease;
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: none;
}

.custom-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
    user-select: none; /* 防止文本被选中 */
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: rgba(74, 108, 247, 0.08);
    transform: translateX(3px);
}

.dropdown-item.selected {
    background-color: rgba(74, 108, 247, 0.12);
}

/* 优化复选框样式 */
.dropdown-item .checkbox-indicator {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    margin-right: 0.5rem;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.dropdown-item.selected .checkbox-indicator {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.dropdown-item.selected .checkbox-indicator:after {
    content: "✓";
    color: white;
    font-size: 0.8rem;
}

/* 优化复选框和标签样式 */
.dropdown-item input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.dropdown-item .checkbox-label {
    cursor: pointer;
    flex: 1;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover .checkbox-label {
    color: var(--primary-color);
}

/* 下拉菜单选项文本 */
.dropdown-item-text {
    flex: 1;
    transition: all 0.2s ease;
}

.dropdown-item:hover .dropdown-item-text {
    color: var(--primary-color);
}

/* 已选择的文件列表 - 文本形式 */
.selected-files-container {
    margin-top: 1rem;
}

.selected-files-container h4 {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--secondary-color);
    display: inline-block;
}

.selected-files-text {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.4;
    min-height: 40px;
}

.empty-selected {
    color: var(--secondary-color);
    font-style: italic;
    font-size: 0.9rem;
}

/* 学生选择器 */
.student-selector-container {
    margin: 1.5rem 0;
    width: 100%;
    max-width: 300px;
}

/* 个人成绩详情表样式 */
.student-info {
    background-color: #f5f7ff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.student-info p {
    margin: 5px 15px 5px 0;
    font-size: 14px;
}

.student-name {
    font-weight: bold;
    color: #4a6cf7;
}

.detail-table-container {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.detail-table th {
    background-color: #4a6cf7;
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
}

.detail-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.detail-table tbody tr:hover {
    background-color: #f9f9f9;
}

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

/* 成绩等级样式 */
.grade-优秀 {
    color: #28a745;
    font-weight: bold;
}

.grade-良好 {
    color: #17a2b8;
    font-weight: bold;
}

.grade-及格 {
    color: #ffc107;
}

.grade-不及格 {
    color: #dc3545;
    font-weight: bold;
}

/* 分数差异样式 */
.positive-diff {
    color: #28a745;
}

.negative-diff {
    color: #dc3545;
}

/* 分数变化样式 */
.positive-change {
    color: #28a745;
    font-weight: bold;
}

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

/* 错误信息样式 */
.error-message {
    color: #dc3545;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* 个人详情分析样式 */
.detail-title {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eaeaea;
    position: relative;
    font-weight: 600;
}

.detail-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, #4a6cf7, #8c9eff);
    border-radius: 3px;
}

.detail-analysis-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.detail-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    padding: 1.8rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(74, 108, 247, 0.1);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.detail-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom, #4a6cf7, #8c9eff);
    border-radius: 3px 0 0 3px;
}

.student-info, .score-summary {
    position: relative;
    background-color: rgba(255, 255, 255, 0.6);
    padding: 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.student-info:hover, .score-summary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.student-info {
    border-left: 3px solid #4a6cf7;
}

.score-summary {
    border-left: 3px solid #28a745;
}

.student-info p, .score-summary p {
    margin: 1rem 0;
    line-height: 1.8;
    font-size: 1rem;
    color: #4c5366;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.student-info p:hover, .score-summary p:hover {
    transform: translateX(5px);
}

.student-info p strong, .score-summary p strong {
    font-weight: 600;
    color: #2c3e50;
    width: 85px;
    display: inline-block;
    margin-right: 10px;
    position: relative;
}

.student-info p strong::after, .score-summary p strong::after {
    content: ':';
    position: absolute;
    right: 0;
}

.score-summary p:first-child {
    font-size: 1.2rem;
    color: #4a6cf7;
    font-weight: 500;
}

.score-summary p:first-child strong {
    color: #4a6cf7;
}

.score-summary p:nth-child(2) strong {
    color: #28a745;
}

.score-summary p:nth-child(3) strong {
    color: #e74c3c;
}

/* 为数据值添加醒目样式 */
.student-info p span, .score-summary p span {
    font-weight: 500;
    background-color: rgba(74, 108, 247, 0.08);
    padding: 3px 8px;
    border-radius: 4px;
}

.score-summary p:first-child span {
    font-size: 1.3rem;
    color: #4a6cf7;
    background-color: rgba(74, 108, 247, 0.12);
    font-weight: 600;
}

/* 适配移动端显示 */
@media (max-width: 768px) {
    .detail-summary {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .detail-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

.subjects-detail {
    margin-top: 1rem;
}

/* 更新排名和进度条显示相关样式 */
.student-info h4, .score-summary h4 {
    margin-top: 0;
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    color: #2c3e50;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 0.7rem;
}

.student-info h4 i, .score-summary h4 i {
    margin-right: 8px;
    color: #4a6cf7;
}

.subjects-detail h4 i, .chart-container h4 i {
    margin-right: 8px;
    color: #4a6cf7;
}

.rank-info {
    margin-bottom: 1.2rem !important;
}

.rank-display {
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: rgba(74, 108, 247, 0.08);
    padding: 5px 10px;
    border-radius: 6px;
}

.rank-number {
    font-weight: 700;
    color: #e74c3c;
    font-size: 1.1rem;
}

.rank-separator {
    color: #7f8c8d;
}

.total-number {
    color: #7f8c8d;
}

.rank-badge {
    margin-left: 8px;
    padding: 3px 8px;
    border-radius: 10px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

.rank-progress-container {
    margin-top: 1rem;
}

.rank-progress-label {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.rank-progress-bar {
    height: 6px;
    background-color: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
}

.rank-progress {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

/* 美化科目卡片 */
.subject-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.subject-card {
    background: white;
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.subject-card h5 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #2c3e50;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.score-info {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.main-score {
    font-size: 2rem;
    font-weight: 700;
    color: #4a6cf7;
    margin: 0;
}

.score-diff {
    font-size: 1rem;
    margin: 0;
}

.score-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.score-stats p {
    display: flex;
    justify-content: space-between;
    margin: 0;
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* 单选文件选择相关样式 */
.selected-file-info {
    margin-top: 1rem;
}

.selected-file-info h4 {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--secondary-color);
    display: inline-block;
}

.selected-file-detail {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.4;
    min-height: 40px;
}

.selected-file-item {
    color: var(--text-color);
    font-size: 0.9rem;
}

/* 添加分析图表容器样式 */
.analysis-chart-container {
    width: 100%;
    height: 500px;
    margin-top: 1.5rem;
    position: relative;
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 跨班级平均分对比分析容器 */
.cross-average-comparison-container {
    padding: 1rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

/* 分析标题样式 */
.analysis-title {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    color: var(--text-color);
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* 增强文件列表项的视觉效果 */
.dropdown-item.with-checkbox {
    display: flex;
    align-items: center;
    padding: 0.85rem 0.75rem;
    cursor: pointer;
    transition: all 0.25s ease;
    border-bottom: 1px solid var(--border-color);
    user-select: none; /* 防止文本被选中 */
    position: relative;
}

.dropdown-item.with-checkbox:hover {
    background-color: rgba(74, 108, 247, 0.08);
    transform: translateX(5px);
    padding-left: 1rem;
}

/* 复选框被选中时的列表项样式 */
.dropdown-item.with-checkbox:has(input:checked) {
    background-color: rgba(74, 108, 247, 0.12);
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

/* 优化复选框和标签样式 */
.dropdown-item.with-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.dropdown-item.with-checkbox .checkbox-label {
    cursor: pointer;
    flex: 1;
    font-size: 1rem;
    transition: all 0.25s ease;
    color: var(--text-color);
}

.dropdown-item.with-checkbox:hover .checkbox-label {
    color: var(--primary-color);
}

/* 复选框被选中时的标签样式 */
.dropdown-item.with-checkbox:has(input:checked) .checkbox-label {
    color: var(--primary-color);
    font-weight: 500;
}

/* 为旧浏览器提供兼容性支持 */
.dropdown-item.with-checkbox input:checked + .checkbox-label {
    color: var(--primary-color);
    font-weight: 500;
}