/* style1.css - 视频播放和管理页面专用样式 */
/* 简化后的购买卡片样式 */
.purchase-card {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 0;
    text-align: center;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s, box-shadow 0.3s;
    width: 100%;
}

.purchase-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.purchase-card a {
    color: white;
    text-decoration: none;
    display: block;
}

.purchase-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}
/* 视频播放页面专用样式 */
.video-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

.video-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 20px;
}

@media (min-width: 1024px) {
    .video-layout {
        flex-direction: row;
    }
}

.video-main {
    flex: 1;
    min-width: 0;
}

.video-sidebar {
    width: 100%;
}

@media (min-width: 1024px) {
    .video-sidebar {
        width: 380px;
    }
}

/* 视频播放器样式 */
.video-player-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 20px;
}

.video-player-header {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.video-player-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.video-player-subtitle {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

.video-player-body {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    background: #000;
}

.video-player-body video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    outline: none;
}

.video-player-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-actions {
    display: flex;
    gap: 12px;
}

.video-action-btn {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.video-action-btn:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.video-action-btn.active {
    background: #6a11cb;
    color: white;
    border-color: #6a11cb;
}

/* 视频列表样式 */
.video-list-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    height: fit-content;
    max-height: 800px;
}

.video-list-header {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.video-list-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-list-title i {
    color: #6a11cb;
}

.video-list-body {
    max-height: 700px;
    overflow-y: auto;
}

.video-list-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.video-list-item:last-child {
    border-bottom: none;
}

.video-list-item:hover {
    background-color: #f9f9f9;
}

.video-list-item.active {
    background-color: #f0e6ff;
    border-left: 4px solid #6a11cb;
}

.video-item-thumb {
    width: 120px;
    height: 68px;
    border-radius: 6px;
    background: #e0e0e0;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.video-item-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(106, 17, 203, 0.3) 0%, rgba(37, 117, 252, 0.3) 100%);
    opacity: 0.7;
    transition: opacity 0.3s;
}

.video-list-item:hover .video-item-thumb::before {
    opacity: 0.5;
}

.video-item-thumb i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5rem;
    z-index: 2;
}

.video-item-content {
    flex: 1;
    min-width: 0;
}

.video-item-title {
    font-weight: 500;
    margin-bottom: 6px;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-item-drama {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 4px;
}

.video-item-duration {
    font-size: 0.8rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 推荐视频区域 */
.recommended-section {
    margin-top: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.view-all-btn {
    color: #6a11cb;
    font-size: 0.9rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

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

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

.video-card-thumb {
    width: 100%;
    height: 160px;
    background: #e0e0e0;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.video-card-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(106, 17, 203, 0.3) 0%, rgba(37, 117, 252, 0.3) 100%);
    opacity: 0.7;
    transition: opacity 0.3s;
}

.video-card:hover .video-card-thumb::before {
    opacity: 0.5;
}

.video-card-body {
    padding: 16px;
}

.video-card-title {
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: #888;
}

.empty-state p {
    margin-bottom: 24px;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .video-page {
        padding: 0 12px;
    }
    
    .video-player-title {
        font-size: 1.25rem;
    }
    
    .video-player-header,
    .video-player-footer {
        padding: 12px 16px;
    }
    
    .video-actions {
        gap: 8px;
    }
    
    .video-action-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .video-list-header {
        padding: 12px 16px;
    }
    
    .video-list-item {
        padding: 12px 16px;
    }
    
    .video-item-thumb {
        width: 100px;
        height: 56px;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
}

/* 导航菜单样式优化 */
.nav-links {
    position: relative;
    z-index: 1000;
}

.nav-links.show {
    z-index: 1001;
}

/* 加载指示器 */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2rem;
    z-index: 10;
}

/* 自动播放提示 */
.autoplay-notice {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 10;
    display: none;
}

/* 视频管理专用样式 */
.video-management {
    max-width: 1200px;
    margin: 0 auto;
}

.form-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    overflow: hidden;
}

.form-header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.form-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    border-color: #6a11cb;
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
    outline: none;
}

.video-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
    position: relative;
}

.video-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.video-item-title {
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.remove-video {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
}

.remove-video:hover {
    background: #c82333;
}

.add-video-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
    margin-top: 8px;
}

.add-video-btn:hover {
    background: #218838;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: #6a11cb;
    color: white;
}

.btn-primary:hover {
    background: #5a0db3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

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

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.table tr:hover {
    background: #f8f9fa;
}

.thumbnail-preview {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.thumbnail-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.upload-form {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-top: 12px;
    border: 1px dashed #dee2e6;
}

.thumbnail-preview-container {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.thumbnail-generate-btn {
    background: #6f42c1;
    color: white;
}

.thumbnail-generate-btn:hover {
    background: #5e35b1;
}

/* 隐藏的canvas用于截图 */
#thumbnailCanvas {
    display: none;
}

/* 确保导航菜单在移动端有足够高的z-index */
.nav-links {
    position: relative;
    z-index: 1000;
}

.nav-links.show {
    z-index: 1001;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .form-body {
        padding: 16px;
    }
    
    .video-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .table th,
    .table td {
        padding: 8px 12px;
    }
    
    .thumbnail-actions {
        flex-direction: column;
    }
}