/* 米醋电子工作室 - 年度竞赛排行榜样式 */
/* © 2024 米醋电子工作室 版权所有 */

/* 主容器样式 */
.annual-top-students-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
    overflow: hidden; /* 恢复隐藏溢出 */
}

.annual-top-students-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    background: radial-gradient(circle, rgba(123, 104, 238, 0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none; /* 确保装饰元素不影响交互 */
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(10deg); }
}

.top-students-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 学员选择器 */
.student-selector {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.student-tab {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 15px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 150px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.student-tab:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.student-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.rank-badge {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.student-tab.active .rank-badge {
    color: #ffd700;
}

.student-name {
    font-size: 16px;
    font-weight: 600;
}

/* 学员内容区域 */
.student-content-area {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    position: relative;
}

.student-card {
    display: none;
    animation: fadeIn 0.5s ease;
}

.student-card.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 学员档案头部 */
.profile-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.student-avatar {
    position: relative;
    min-width: 120px;
}

.avatar-circle {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.avatar-icon {
    font-size: 60px;
}

.rank-ribbon {
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    color: #333;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.student-info h3 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
}

.student-title {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* 成就板块 */
.achievements-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 20px;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: #667eea;
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.achievement-item {
    background: #f8f9fa;
    border-left: 4px solid #ccc;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.achievement-item:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.achievement-item.national-first {
    border-left-color: #ffd700;
    background: linear-gradient(to right, rgba(255, 215, 0, 0.1), transparent);
}

.achievement-item.national-second {
    border-left-color: #c0c0c0;
    background: linear-gradient(to right, rgba(192, 192, 192, 0.1), transparent);
}

.achievement-item.provincial-first {
    border-left-color: #cd7f32;
    background: linear-gradient(to right, rgba(205, 127, 50, 0.1), transparent);
}

.achievement-icon {
    font-size: 24px;
}

.achievement-text {
    flex: 1;
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

/* 寄语板块 */
.message-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
}

.message-section .section-title {
    position: relative;
    justify-content: space-between;
    margin-bottom: 0;
}

.toggle-message-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.toggle-message-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.toggle-message-btn i {
    transition: transform 0.3s ease;
}

.toggle-message-btn.expanded i {
    transform: rotate(180deg);
}

.message-content {
    margin-top: 20px;
    max-height: 400px; /* 设置固定的最大高度 */
    overflow: hidden;
    opacity: 1;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease,
                margin-top 0.3s ease;
}

.message-content.collapsed {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease,
                margin-top 0.3s ease;
}

.message-text {
    padding: 20px;
    padding-right: 12px; /* 给滚动条留空间 */
    background: white;
    border-radius: 10px;
    line-height: 1.8;
    max-height: 380px; /* 留出一些空间给padding */
    overflow-y: auto; /* 内部滚动 */
    overflow-x: hidden;
    position: relative;
}

/* 滚动时的淡入淡出效果 */
.message-text::before,
.message-text::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 20px;
    pointer-events: none;
    z-index: 1;
}

.message-text::before {
    top: 0;
    background: linear-gradient(to bottom, white 0%, transparent 100%);
}

.message-text::after {
    bottom: 0;
    background: linear-gradient(to top, white 0%, transparent 100%);
}

/* 自定义滚动条样式 */
.message-text::-webkit-scrollbar {
    width: 8px;
}

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

.message-text::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.message-text::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Firefox滚动条样式 */
.message-text {
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f1f1;
}

.message-text p {
    margin-bottom: 15px;
    color: #444;
    text-align: justify;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text strong {
    color: #667eea;
    font-weight: 600;
}

.message-text ul {
    margin: 15px 0;
    padding-left: 30px;
}

.message-text ul li {
    margin-bottom: 10px;
    color: #555;
}

/* 奖学金标注 */
.scholarship-note {
    margin-top: 15px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 183, 0, 0.1));
    border-left: 3px solid #ffd700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.scholarship-note i {
    color: #ffd700;
    font-size: 18px;
}

/* 敬请期待卡片 */
.coming-soon-card {
    text-align: center;
    padding: 80px 40px;
    color: #999;
}

.coming-soon-icon {
    font-size: 60px;
    margin-bottom: 20px;
    color: #ddd;
}

.coming-soon-card h3 {
    font-size: 24px;
    color: #666;
    margin-bottom: 10px;
}

.coming-soon-card p {
    font-size: 16px;
    color: #999;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .annual-top-students-section {
        padding: 60px 0;
    }
    
    .student-selector {
        gap: 10px;
    }
    
    .student-tab {
        min-width: 130px;
        padding: 12px 20px;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .student-content-area {
        padding: 20px;
    }
    
    .achievement-item {
        padding: 12px 15px;
    }
    
    .achievement-text {
        font-size: 14px;
    }
    
    .message-content {
        max-height: 300px; /* 移动端较小的高度 */
    }
    
    .message-text {
        padding: 15px;
        font-size: 14px;
        max-height: 280px; /* 移动端调整高度 */
    }
    
    .message-text p {
        font-size: 14px;
        line-height: 1.6;
    }
    
    /* 移动端滚动条更细 */
    .message-text::-webkit-scrollbar {
        width: 6px;
    }
}

@media (max-width: 480px) {
    .student-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .student-tab {
        width: 90%;
        max-width: 300px;
    }
    
    .avatar-circle {
        width: 100px;
        height: 100px;
    }
    
    .avatar-icon {
        font-size: 50px;
    }
    
    .student-info h3 {
        font-size: 22px;
    }
}