/* === 成绩单页面专用样式 === */

/* 基础全局 - 与chome一致 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #333;
    background-color: #ffffff;
    line-height: 1.6;
    margin: 0;
    padding: 0 20px 80px 20px;
    scrollbar-width: none; 
    -ms-overflow-style: none;
}
body::-webkit-scrollbar { display: none; }

#layout-content {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 20px;
}

/* 页面标题区域 */
.grade-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
}

.grade-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #111;
    margin: 0 0 15px 0;
    letter-spacing: -0.5px;
}

.header-subtitle {
    font-size: 15px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    opacity: 0.9;
}

/* 返回链接 */
.back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 8px 16px;
    background-color: #f5f7fa;
    color: #333;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
}

.back-link:hover {
    background-color: #e4e7eb;
    text-decoration: none;
}

/* 成绩概览卡片 */
.grade-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.overview-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.02);
    text-align: center;
    transition: all 0.3s ease;
}

.overview-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    border-color: #e0e7ff;
    transform: translateY(-3px);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
    font-feature-settings: "tnum";
}

.stat-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 绩点指示器 */
.gpa-indicator {
    background: #f8fafc;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.gpa-value {
    font-size: 48px;
    font-weight: 700;
    color: #0066cc;
    margin: 0 0 10px 0;
    font-feature-settings: "tnum";
}

.gpa-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gpa-scale {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}

.scale-item {
    text-align: center;
}

.scale-value {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.scale-label {
    font-size: 12px;
    color: #888;
}

/* PDF容器 */
.pdf-container {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.02);
    margin-bottom: 40px;
    overflow: hidden;
}

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

.pdf-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    margin: 0;
}

.pdf-actions {
    display: flex;
    gap: 10px;
}

.pdf-btn {
    padding: 8px 16px;
    background: #f5f7fa;
    color: #333;
    border: 1px solid #e4e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.pdf-btn:hover {
    background: #e4e7eb;
    text-decoration: none;
}

.pdf-btn.download {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

.pdf-btn.download:hover {
    background: #0055aa;
}

.pdf-viewer {
    width: 100%;
    height: 700px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}

/* 课程分类统计 */
.course-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.course-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #f0f0f0;
    text-align: center;
}

.course-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
}

.course-stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.course-progress {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.course-progress-bar {
    height: 100%;
    background: #0066cc;
    border-radius: 3px;
    width: 0;
    animation: progressFill 1.2s ease-out forwards;
}

/* 成绩趋势图容器 */
.trend-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid #e2e8f0;
}

.trend-header {
    margin-bottom: 25px;
}

.trend-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    margin: 0 0 10px 0;
}

.trend-description {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.trend-placeholder {
    height: 200px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 15px;
}

/* 页脚 */
#footer {
    margin-top: 80px;
    font-size: 13px;
    color: #aaa;
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #f0f0f0;
}

/* 动画 */
@keyframes progressFill {
    from { width: 0; }
    to { width: var(--progress-width, 80%); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 0 15px 60px 15px;
    }
    
    .grade-overview {
        grid-template-columns: 1fr;
    }
    
    .pdf-viewer {
        height: 500px;
    }
    
    .pdf-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .pdf-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .gpa-scale {
        flex-direction: column;
        gap: 15px;
    }
    
    .course-stats {
        grid-template-columns: 1fr;
    }
    
    .back-link {
        position: relative;
        top: 0;
        left: 0;
        margin-bottom: 20px;
        display: inline-block;
    }
}

/* 隐藏滚动条 */
::-webkit-scrollbar {
    display: none;
    width: 0 !important;
    height: 0 !important;
}

html, body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}


.pdf-viewer-container {
    position: relative;
    width: 100%;
    transition: all 0.3s ease;
}

.pdf-viewer {
    width: 100%;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.pdf-viewer.hidden {
    height: 0;
    opacity: 0;
    border: none;
    overflow: hidden;
}

.pdf-viewer.visible {
    height: 700px;
    opacity: 1;
    margin-bottom: 20px;
}

/* PDF占位符 */
.pdf-placeholder {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 60px 30px;
    text-align: center;
    border: 2px dashed #e0e7ff;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.pdf-placeholder.hidden {
    display: none;
}

.pdf-placeholder.visible {
    display: block;
}

.placeholder-icon {
    font-size: 48px;
    color: #cbd5e0;
    margin-bottom: 20px;
}

.placeholder-title {
    font-size: 18px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 10px;
}

.placeholder-description {
    font-size: 14px;
    color: #718096;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* PDF加载状态 */
.pdf-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 10;
    border-radius: 8px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e7ff;
    border-top: 3px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.loading-text {
    font-size: 14px;
    color: #666;
}

/* 全屏查看模式 */
.pdf-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    display: none;
}

.pdf-fullscreen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-fullscreen iframe {
    width: 90%;
    height: 90%;
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.close-fullscreen {
    position: absolute;
    top: 20px;
    right: 30px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-fullscreen:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* PDF状态指示器 */
.pdf-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
    padding: 10px 15px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    color: #4a5568;
}

.pdf-size {
    font-weight: 600;
    color: #0066cc;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .pdf-viewer.visible {
        height: 500px;
    }
    
    .pdf-fullscreen iframe {
        width: 95%;
        height: 95%;
    }
}
        /* 添加PDF隐藏/显示相关的样式 */
        .pdf-viewer-container {
            position: relative;
            width: 100%;
            transition: all 0.3s ease;
        }
        
        .pdf-viewer {
            width: 100%;
            border: 1px solid #f0f0f0;
            border-radius: 8px;
            overflow: hidden;
            background: #f8f9fa;
            transition: all 0.3s ease;
        }
        
        .pdf-viewer.hidden {
            height: 0;
            opacity: 0;
            border: none;
            overflow: hidden;
        }
        
        .pdf-viewer.visible {
            height: 700px;
            opacity: 1;
            margin-bottom: 20px;
        }
        
        .pdf-placeholder {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 60px 30px;
            text-align: center;
            border: 2px dashed #e0e7ff;
            margin-bottom: 20px;
            transition: all 0.3s ease;
            cursor: pointer;
        }
        
        .pdf-placeholder:hover {
            background: #f0f7ff;
            border-color: #0066cc;
            transform: translateY(-2px);
            box-shadow: 0 5px 20px rgba(0, 102, 204, 0.1);
        }
        
        .pdf-placeholder.hidden {
            display: none;
        }
        
        .pdf-placeholder.visible {
            display: block;
        }
        
        .placeholder-icon {
            font-size: 48px;
            color: #cbd5e0;
            margin-bottom: 20px;
            transition: all 0.3s ease;
        }
        
        .pdf-placeholder:hover .placeholder-icon {
            color: #0066cc;
            transform: scale(1.1);
        }
        
        .placeholder-title {
            font-size: 18px;
            font-weight: 600;
            color: #4a5568;
            margin-bottom: 10px;
            transition: color 0.3s;
        }
        
        .pdf-placeholder:hover .placeholder-title {
            color: #0066cc;
        }
        
        .placeholder-description {
            font-size: 14px;
            color: #718096;
            max-width: 500px;
            margin: 0 auto;
            line-height: 1.6;
        }
        
        .placeholder-hint {
            margin-top: 15px;
            padding: 8px 16px;
            background: rgba(0, 102, 204, 0.05);
            color: #0066cc;
            border-radius: 20px;
            font-size: 12px;
            display: inline-block;
            font-weight: 500;
            border: 1px solid rgba(0, 102, 204, 0.1);
            transition: all 0.3s;
        }
        
        .pdf-placeholder:hover .placeholder-hint {
            background: rgba(0, 102, 204, 0.1);
        }
        
        .spinner {
            width: 40px;
            height: 40px;
            border: 3px solid #e0e7ff;
            border-top: 3px solid #0066cc;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 15px;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        .pdf-fullscreen {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 1000;
            background: rgba(0, 0, 0, 0.9);
            padding: 20px;
            display: none;
        }
        
        .pdf-fullscreen.active {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .pdf-fullscreen iframe {
            width: 90%;
            height: 90%;
            border: none;
            border-radius: 8px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        }
        
        .close-fullscreen {
            position: absolute;
            top: 20px;
            right: 30px;
            background: rgba(255, 255, 255, 0.1);
            color: white;
            border: none;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            font-size: 20px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }
        
        .close-fullscreen:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: scale(1.1);
        }
        
        @media (max-width: 768px) {
            .pdf-viewer.visible {
                height: 500px;
            }
            
            .pdf-fullscreen iframe {
                width: 95%;
                height: 95%;
            }
            
            .pdf-placeholder {
                padding: 40px 20px;
            }
        }