/* 通用样式文件 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* 侧边栏通用样式 */
.sidebar {
    width: 80px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    margin-bottom: 40px;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    text-decoration: none;
    color: #666;
    font-size: 12px;
    border-radius: 12px;
    transition: all 0.3s;
}

.nav-item:hover, .nav-item.active {
    background: #f0f0f0;
    color: #ff6b00;
}

.nav-item img {
    width: 40px;
    height: 28px;
    margin-bottom: 5px;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: auto;
}

.sidebar-footer img {
    width: 32px;
    height: 32px;
    cursor: pointer;
}

.user-avatar {
    border-radius: 50%;
    border: 2px solid #ff6b00;
}

.user-points {
    font-size: 11px;
    color: #999;
}

/* 分类标签容器 */
.category-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* 分类标签通用样式 - 缩小版 */
.category-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.category-item {
    padding: 5px 12px;
    background: #fff;
    color: #666;
    text-decoration: none;
    border-radius: 15px;
    font-size: 12px;
    transition: all 0.3s;
    white-space: nowrap;
}

.category-item:hover, .category-item.active {
    background: #333;
    color: #fff;
}

/* 视频标签通用样式 - 缩小版 */
.video-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.video-tag {
    background: #f5f5f5;
    color: #999;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
}

/* 按钮通用样式 */
.btn {
    cursor: pointer;
    transition: transform 0.2s;
    border: none;
    font-weight: 600;
}

.btn:hover {
    transform: scale(1.05);
}

/* 容器通用样式 */
.container {
    display: flex;
    min-height: 100vh;
}

/* 视频网格和卡片通用样式 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.video-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.video-thumbnail {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.video-thumbnail img,
.video-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-preview {
    display: block;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 10;
}

.video-card:hover .play-icon {
    opacity: 0;
}

.play-icon img {
    width: 40px;
    height: 40px;
}

.video-info {
    padding: 15px;
}

.video-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.author span {
    font-size: 13px;
    color: #666;
}

.views {
    font-size: 13px;
    color: #999;
}

/* 弹窗通用样式 */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
}

.video-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    max-width: 1000px;
    margin: 80px auto;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    animation: modalIn 0.3s ease-out;
    border: 2px solid #333;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 40px;
    height: 40px;
    border: none;
    background: #ff6b00;
    color: #fff;
    font-size: 28px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #e55a00;
    transform: rotate(90deg);
}

.modal-header {
    padding: 30px 40px 0;
}

.share-section {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 12px 20px;
    border-radius: 12px;
}

.share-icon img {
    width: 40px;
}

.share-text {
    font-size: 28px;
    font-weight: 700;
    color: #c00;
}

.modal-layout {
    display: flex;
    gap: 40px;
    padding: 20px 40px 40px;
}

.modal-video-section {
    flex: 1.1;
    display: flex;
    flex-direction: column;
}

.modal-video-container {
    flex: 1;
    position: relative;
    background: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
}

.modal-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 25px;
    background: #f8f9fa;
    margin-top: 15px;
    border-radius: 8px;
}

.ai-label {
    background: #999;
    color: #fff;
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.volume-control {
    position: absolute;
    bottom: 20px;
    right: 20px;
}

.volume-btn {
    width: 35px;
    height: 35px;
    border: none;
    background: #999;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.volume-btn:hover {
    background: #777;
}

.volume-icon {
    font-size: 18px;
}

.modal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.modal-author {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.author-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 3px solid #ffc966;
}

.author-name {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.modal-tags {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.modal-tag {
    padding: 5px 10px;
    background: #f5f5f5;
    color: #666;
    border-radius: 25px;
    font-size: 13px;
}

.textarea-label {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: block;
}

.modal-textarea {
    width: 100%;
    flex: 1;
    min-height: 220px;
    padding: 22px;
    border: 1px solid #eee;
    border-radius: 0px;
    font-size: 14px;
    line-height: 1.9;
    color: #444;
    resize: none;
    background: #fafafa;
    font-family: inherit;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.copy-btn, .favorite-btn {
    padding: 10px 32px;
    background: #ff6b00;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
}

.favorite-btn {
    background: #6c757d;
}

.favorite-btn:hover {
    background: #5a6268;
}

.btn-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* 响应式通用样式 */
@media (max-width: 1200px) {
    .modal-layout {
        flex-direction: column;
        gap: 30px;
    }
    
    .modal-video-container {
        min-height: 450px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .modal-content {
        margin: 15px;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 25px 20px 0;
    }
    
    .modal-layout {
        padding: 15px 20px 25px;
    }
    
    .modal-info {
        padding: 0;
    }
    
    .modal-title {
        font-size: 24px;
    }
    
    .modal-video-container {
        min-height: 350px;
    }
    
    .modal-textarea {
        min-height: 220px;
        font-size: 14px;
    }
    
    .copy-btn, .favorite-btn {
        font-size: 15px;
        padding: 14px 28px;
    }
}