/* 继承共享样式特性 */
@import url('style.css');

/* 页面布局 */
.defense-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 80px;
}

.content-area {
    margin-top: 20px;
}

.section-header {
    border-bottom: 2px solid #007bff;
    margin-bottom: 20px;
    width: 100%;
}

.section-header h2 {
    font-size: 24px;
    margin: 0;
    padding-bottom: 10px;
}

/* 视频网格布局 */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    font-size: 24px;
}

.video-item {
    width: 100%;
    height: 420px !important;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
}

.video-preview {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
}

.video-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-stats {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 12px;
}

.video-stats span {
    padding: 0 8px;  /* 每个状态的两侧添加内边距 */
}

.video-section h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #007bff;
}

.upload-info {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* 评分和收藏区域 */
.rating-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.rating-input {
    width: 60px;
    padding: 0.25rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.rate-btn, .favorite-btn {
    padding: 0.25rem 0.75rem;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.rate-btn.rated {
    background-color: #28a745;
}

.favorite-btn.favorited {
    background-color: #007bff;
}

/* 评论区域 - 更新后的样式 */
.comments-section {
    border-top: 1px solid #eee;
    padding: 1rem;
    height: 150px !important;
    overflow-y: auto;
    flex-shrink: 0;
}

.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.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.comment-author {
    font-weight: bold;
    margin-right: 0.5rem;
}

.comment-time {
    color: #666;
    font-size: 0.8rem;
}

.comment-content {
    margin-top: 0.25rem;
}

/* 上传按钮样式 */
.upload-button-container {
    position: fixed;
    top: auto;        /* 重置 homework.css 的 top:100px，防止容器被拉伸 */
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.upload-button {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.upload-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    color: white;
    text-decoration: none;
}

.upload-button i {
    margin-right: 8px;
}

/* 顶部栏样式 */
.top-bar {
    position: fixed;
    top: 100px;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 20px;
    z-index: 100;
}

/* 按钮样式 */
.btn-primary {
    display: inline-block;
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
}

.btn-primary:hover {
    background-color: #0056b3;
    color: white;
    text-decoration: none;
}

/* 视频容器 */
.videos-container {
    padding-top: 100px;
}

/* 视频区域样式 */
.video-section {
    margin-bottom: 40px;
}

.video-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
    width: 100%;  /* 确保分割线到达右侧 */
}

/* 视频列表样式 */
.video-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px;
}

/* 视频项目样式 */
.video-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.video-item video {
    width: 100%;
    height: auto;
}

.video-info {
    padding: 10px;
}

.video-info p {
    margin: 5px 0 0;
    font-size: 14px;
    color: #666;
}

/* 视频网格 */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* 视频卡片 */
.video-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.video-preview {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 比例 */
}

.video-preview video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 视频信息 */
.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.author {
    color: #666;
}

/* 视频操作区域 */
.video-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* 修改视频容器样式 */
.video-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    padding: 20px;
}

.video-item {
    width: 100%;
    margin-bottom: 20px;
}

.video-item video {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

/* 添加功能区域样式 */
.video-actions {
    margin-top: 10px;
    padding: 10px;
    border-top: 1px solid #eee;
}

.rating-section {
    margin-bottom: 10px;
}

.rating-section input {
    width: 60px;
    margin: 0 10px;
    padding: 5px;
}

