/**
 * 视频播放卡片样式
 * Updated: 2026-03-09
 */

/* 视频卡片容器 */
.video-player-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 24px auto !important; /* 居中显示 */
    max-width: 800px; /* 限制最大宽度 */
    transition: all var(--transition-normal);
}

/* 确保帖子内的视频卡片有左右间距 */
.post-detail .video-player-card,
.post-body .video-player-card,
.post-body-discuz .video-player-card,
article .video-player-card {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 800px !important;
}

.video-player-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
}

/* 视频头部区域 */
.video-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border-light);
}

.video-header-left {
    flex: 1;
    min-width: 0;
}

.video-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-title i.ri-video-line {
    color: var(--primary-color);
    font-size: 20px;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.video-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.video-meta .meta-item i {
    font-size: 14px;
    color: var(--text-secondary);
}

.video-platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
}

.video-platform-badge.bilibili {
    background: rgba(251, 114, 153, 0.1);
    color: #fb7299;
}

.video-platform-badge.youtube {
    background: rgba(255, 0, 0, 0.1);
    color: #ff0000;
}

.video-platform-badge.custom {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

/* 视频描述 */
.video-description {
    padding: 16px 20px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

/* 视频播放器区域 */
.video-player-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 宽高比 */
    background: #000;
}

.video-player-wrapper iframe,
.video-player-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-player-wrapper video {
    object-fit: contain;
}

/* 视频封面 */
.video-cover {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    cursor: pointer;
    overflow: hidden;
}

.video-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-cover:hover img {
    transform: scale(1.05);
}

.video-cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.video-cover:hover .video-cover-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.video-play-btn {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.video-cover:hover .video-play-btn {
    background: #fff;
    transform: scale(1.1);
}

.video-play-btn i {
    font-size: 36px;
    color: var(--primary-color);
    margin-left: 4px;
}

/* 视频锁定状态 */
.video-locked {
    position: relative;
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.video-locked-overlay {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-locked-overlay i {
    font-size: 36px;
    color: #64748b;
}

.video-locked-message p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 20px 0;
}

.video-unlock-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--primary-color);
    color: #fff !important;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.video-unlock-btn:hover,
.video-unlock-btn:active,
.video-unlock-btn:focus {
    background: #1d4ed8;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    text-decoration: none;
}

/* 视频解锁选项 */
.video-unlock-options {
    display: flex;
    flex-direction: row;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
    align-items: stretch;
}

.video-unlock-option {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.video-unlock-option:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.1);
}

.video-unlock-option .option-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.video-unlock-option .option-header i {
    font-size: 18px;
}

.video-unlock-option .option-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
}

/* 发帖页视频编辑器 */
.video-upload-section {
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 20px;
}

.video-upload-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.video-upload-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.video-upload-header h3 i {
    color: var(--primary-color);
}

.video-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.video-upload-body {
    display: block;
}

.video-toggle-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.video-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
}

.video-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.video-toggle-tip {
    font-size: 12px;
    color: var(--text-muted);
}

.video-form-grid {
    display: none;
}

.video-form-grid.active {
    display: block;
}

.video-field-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.video-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.video-field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-field input,
.video-field select,
.video-field textarea {
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-secondary);
    transition: all var(--transition-fast);
}

.video-field input:focus,
.video-field select:focus,
.video-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.video-field textarea {
    resize: vertical;
    min-height: 80px;
}

.field-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.video-tip-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.video-tip-box i {
    color: var(--primary-color);
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.video-upload-locked {
    text-align: center;
    padding: 40px 20px;
}

.video-upload-locked i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
    display: block;
}

.video-upload-locked p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.btn-level-up {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--primary-color);
    color: #fff !important;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.btn-level-up:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 响应式 */
@media (max-width: 768px) {
    .video-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .video-platform-badge {
        align-self: flex-start;
    }
    
    .video-unlock-options {
        flex-direction: column;
        max-width: 100%;
        gap: 16px;
    }
    
    .video-unlock-option {
        padding: 16px;
    }
    
    .video-field-row {
        grid-template-columns: 1fr;
    }
    
    .video-play-btn {
        width: 60px;
        height: 60px;
    }
    
    .video-play-btn i {
        font-size: 28px;
    }
}


/* ==================== 试看功能样式 ==================== */

/* 试看视频容器 */
.video-preview-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 宽高比 */
    height: 0;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 20px 0;
}

/* 试看视频播放器 */
.video-preview-wrapper video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    object-fit: contain;
}

/* 试看遮罩层 */
.video-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 遮罩内容 */
.preview-overlay-content {
    text-align: center;
    padding: 30px 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 隐藏滚动条但保持滚动功能 */
.preview-overlay-content::-webkit-scrollbar {
    width: 6px;
}

.preview-overlay-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.preview-overlay-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.preview-overlay-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 锁定图标 */
.preview-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--primary-color), #60a5fa);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.preview-icon i {
    font-size: 36px;
    color: #fff;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(59, 130, 246, 0);
    }
}

/* 标题 */
.preview-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px 0;
}

/* 提示文本 */
.preview-message {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 6px 0;
}

.preview-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 20px 0;
}

/* 购买按钮容器 - 使用网格布局 */
.preview-purchase-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
    width: 100%;
    max-width: 600px;
}

/* 购买按钮 */
.preview-purchase-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary-color), #60a5fa);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    width: 100%;
    min-height: 48px;
}

.preview-purchase-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.preview-purchase-btn:active {
    transform: translateY(0);
}

.preview-purchase-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.preview-purchase-btn i {
    font-size: 16px;
}

/* 金币购买按钮 */
.purchase-video-coins-btn.preview-purchase-btn {
    background: linear-gradient(135deg, #10b981, #34d399);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.purchase-video-coins-btn.preview-purchase-btn:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* 自定义货币购买按钮 */
.purchase-video-custom-btn.preview-purchase-btn {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.purchase-video-custom-btn.preview-purchase-btn:hover {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .preview-overlay-content {
        padding: 20px 15px;
        max-width: 90%;
    }
    
    .preview-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 12px;
    }
    
    .preview-icon i {
        font-size: 26px;
    }
    
    .preview-title {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .preview-message {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .preview-hint {
        font-size: 12px;
        margin-bottom: 16px;
    }
    
    .preview-purchase-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 12px;
        max-width: 100%;
    }
    
    .preview-purchase-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .preview-purchase-btn i {
        font-size: 14px;
    }
}
