/* 页面整体布局 */
.homework-page {
    max-width: 1800px;
    margin: 73px auto 0;
    padding: 2rem;
}

/* 上传按钮容器 */
.upload-button-container {
    position: fixed;
    top: 100px; /* 调整位置，确保在导航栏下方 */
    right: 40px;
    z-index: 100;
}

.upload-button {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    min-width: 160px;  /* 增加最小宽度以适应更长的文字 */
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 18px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    justify-content: center;  /* 确保文字居中 */
}

.upload-btn:hover {
    background-color: #0056b3;
}

/* 精品视频区域 */
.featured-videos {
    margin-bottom: 4rem;
}

.featured-videos h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #007bff;
}

.featured-videos-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.featured-video-card {
    position: relative;
    width: calc(25% - 2rem);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* 全部视频区域 */
.all-videos {
    margin-bottom: 2rem;
}

.all-videos h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #007bff;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

/* 视频卡片样式 */
.video-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.video-preview {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
}

.video-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 视频信息区域 */
.video-info {
    padding: 1rem;
}

.video-info .title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 18px;
}

.video-info .author {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0rem;
}

.video-stats {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 14px;
}

.video-stats span {
    padding-right: 15px;  /* 每个状态的两侧添加内边距 */
}

/* 评分和收藏区域 */
.rating-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.rating-input {
    width: 50px;
    padding: 0.25rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
}

.rate-btn, .favorite-btn {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.rate-btn {
    background-color: #6c757d;
    color: white;
}

.rate-btn.rated {
    background-color: #28a745;
}

.favorite-btn {
    background-color: #6c757d;
    color: white;
}

.favorite-btn.favorited {
    background-color: #007bff;
}

/* 讨论区样式 */
.comments-section {
    border-top: 1px solid #eee;
    padding: 0rem;
    height: 150px; /* 与三行文字高度相当 */
    overflow-y: auto;
}

.comment-input-section {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.comment-input {
    flex: 1;
    padding: 0.25rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.comment-btn {
    padding: 0.25rem 0.75rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.comments-list {
    font-size: 0.9rem;
}

.comment-item {
    margin-bottom: 0.2rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid #eee;
}

.comment-item span {
    padding-right: 10px;    /* 左右各添加10px的内边距 */
    /* 或者使用更大的值 */
    /* padding: 0 15px; */  /* 左右各添加15px的内边距 */
}

.comment-author {
    font-weight: bold;
    margin-right: 0.5rem;
}

.comment-time {
    color: #666;
    font-size: 0.8rem;
}

/* 排名标志 */
.rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    background-color: #ff4757;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.rank-badge.gold {
    background-color: #ffd700;
}

.rank-badge.silver {
    background-color: #c0c0c0;
}

.rank-badge.bronze {
    background-color: #cd7f32;
}

/* 响应式布局 */
@media (max-width: 1600px) {
    .videos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .videos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .videos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .featured-videos-container {
        flex-direction: column;
    }
    
    .featured-video-card {
        width: 100%;
    }
}

/* 上传模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}

.subject-options {
    display: flex;
    gap: 2rem;
}

select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
} 