/* Video Product Widget Styles */
/* 视频产品网格布局 */
.video-products-grid {
    display: grid;
    gap: 16px;
}

.video-products-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.video-products-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.video-products-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.video-products-grid.columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.video-products-grid.columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* 视频产品卡片样式 */
.video-product-card {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.video-product-card .card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.video-product-card .card-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 比例 */
    overflow: hidden;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

/* 视频加载占位符动画 */
.video-product-card.no-thumbnail .card-thumbnail::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: rgba(255,255,255,0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

.video-product-card.poster-generated .card-thumbnail::before {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.video-product-card .card-thumbnail img,
.video-product-card .card-thumbnail video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.video-product-card .card-thumbnail .hover-video {
    z-index: 2;
}

.video-product-card .card-thumbnail .thumbnail-img {
    z-index: 3;
}

.video-product-card.video-playing .card-thumbnail .thumbnail-img {
    opacity: 0;
}

/* 生成的封面图 */
.video-product-card .card-thumbnail .generated-poster {
    z-index: 3;
}

.video-product-card.video-playing .card-thumbnail .generated-poster {
    opacity: 0;
}

/* 视频信息（时长和清晰度） */
.video-product-card .video-info {
    position: absolute;
    left: 10px;
    bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(102, 102, 102, 0.7);
    border-radius: 4px;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.video-product-card:hover .video-info {
    opacity: 0;
}

.video-product-card .video-duration,
.video-product-card .video-resolution {
    display: inline-flex;
    align-items: center;
    color: #fff;
    font-size: 13px;
    font-weight: 400;
}

/* 悬停遮罩 */
.video-product-card .card-hover-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    padding: 40px 12px 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
}

.video-product-card:hover .card-hover-overlay {
    opacity: 1;
    visibility: visible;
}

.video-product-card .hover-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* 标题 */
.video-product-card .hover-title {
    flex: 1;
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 操作按钮区域 */
.video-product-card .hover-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.video-product-card .action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 6px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.video-product-card .action-btn:hover {
    background: rgba(255, 255, 255, 0.95);
}

.video-product-card .action-btn svg {
    width: 20px;
    height: 20px;
}

/* 按钮自定义tooltip */
.video-product-card .action-btn .btn-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding-bottom: 14px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
    background: transparent;
}

.video-product-card .action-btn .btn-tooltip-inner {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* 底部尖角 */
.video-product-card .action-btn .btn-tooltip::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 0, 0, 0.6);
}

.video-product-card .action-btn:hover .btn-tooltip,
.video-product-card .action-btn .btn-tooltip:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.video-product-card .action-btn .tooltip-open-modal {
    display: block;
    padding: 6px 12px;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
}

.video-product-card .action-btn .tooltip-quick-fav {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 12px 6px;
    color: #4dabf7;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
}

.video-product-card .action-btn .tooltip-quick-fav svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.video-product-card .favorite-list {
    padding: 6px 0;
}

.video-product-card .favorite-item {
    padding: 8px 12px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: background 0.2s;
}

.video-product-card .favorite-item:hover {
    background: #f5f5f5;
    color: #333;
}

/* 已收藏状态 */
.video-product-card .favorite-btn.is-favorited > svg {
    fill: #ff4d4f;
    color: #ff4d4f;
}

/* Toast提示 */
.video-product-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 14px;
    border-radius: 6px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    pointer-events: none;
}

.video-product-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 响应式 */
@media (max-width: 1024px) {
    .video-products-grid.columns-5,
    .video-products-grid.columns-6 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .video-products-grid.columns-3,
    .video-products-grid.columns-4,
    .video-products-grid.columns-5,
    .video-products-grid.columns-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .video-products-grid {
        gap: 10px;
    }
    
    .video-product-card .hover-title {
        font-size: 13px;
    }
    
    .video-product-card .action-btn {
        width: 28px;
        height: 28px;
    }
    
    .video-product-card .action-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .video-product-card .video-duration,
    .video-product-card .video-resolution {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .video-products-grid.columns-2,
    .video-products-grid.columns-3,
    .video-products-grid.columns-4,
    .video-products-grid.columns-5,
    .video-products-grid.columns-6 {
        grid-template-columns: 1fr;
    }
}

/* 收藏夹弹窗样式 */
.favorite-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 100000 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

.favorite-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.favorite-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.favorite-modal-content {
    position: relative !important;
    width: 520px !important;
    max-width: calc(100vw - 40px) !important;
    min-height: 280px !important;
    background: #fff !important;
    border-radius: 16px !important;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2) !important;
    transform: translateY(16px) scale(0.97);
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden !important;
    max-height: calc(100vh - 80px) !important;
    display: flex !important;
    flex-direction: column !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.favorite-modal.active .favorite-modal-content {
    transform: translateY(0) scale(1);
}

.favorite-modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    padding: 24px 28px !important;
    border: none !important;
    flex-shrink: 0 !important;
    background: #fff !important;
    margin: 0 !important;
}

.favorite-modal-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    letter-spacing: -0.01em !important;
    border: none !important;
    background: none !important;
    line-height: 1.4 !important;
}

.favorite-modal-close {
    position: absolute !important;
    right: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 34px !important;
    height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    color: #999 !important;
    cursor: pointer !important;
    transition: color 0.15s ease !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    box-shadow: none !important;
}

.favorite-modal-close:hover {
    background: none !important;
    color: #333 !important;
    border: none !important;
    box-shadow: none !important;
}

.favorite-modal-close svg {
    width: 14px !important;
    height: 14px !important;
}

.favorite-modal-body {
    padding: 20px 24px 28px !important;
    overflow-y: auto !important;
    flex: 1 !important;
    background: #fff !important;
    border: none !important;
    margin: 0 !important;
}

.favorite-search-wrapper {
    position: relative !important;
    margin-bottom: 16px !important;
    border: none !important;
    padding: 0 !important;
}

.favorite-modal .favorite-search-input,
.favorite-search-input {
    width: 100% !important;
    height: 46px !important;
    padding: 0 60px 0 16px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    color: #333 !important;
    outline: none !important;
    transition: border-color 0.2s !important;
    box-sizing: border-box !important;
    background: #f5f5f5 !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.favorite-modal .favorite-search-input:focus,
.favorite-search-input:focus {
    border-color: #ff4d4f !important;
    background: #f5f5f5 !important;
    box-shadow: none !important;
}

.favorite-modal .favorite-search-input::placeholder,
.favorite-search-input::placeholder {
    color: #bbb !important;
}

.favorite-char-count {
    position: absolute !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 13px !important;
    color: #ccc !important;
    font-variant-numeric: tabular-nums !important;
    border: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.favorite-folder-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.favorite-modal .favorite-folder-item,
.favorite-folder-item {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 14px 16px !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    background: transparent !important;
    margin: 0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.favorite-modal .favorite-folder-item:hover,
.favorite-folder-item:hover {
    background: rgba(255, 77, 79, 0.08) !important;
    box-shadow: none !important;
}

.favorite-modal .favorite-folder-item:active,
.favorite-folder-item:active {
    background: rgba(255, 77, 79, 0.14) !important;
}

.favorite-folder-item.selected {
    background: rgba(255, 77, 79, 0.08) !important;
}

.favorite-modal .favorite-folder-item .folder-name,
.favorite-folder-item .folder-name {
    font-size: 15px !important;
    color: #333 !important;
    font-weight: 500 !important;
    border: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.favorite-modal .favorite-folder-item:hover .folder-name,
.favorite-folder-item:hover .folder-name {
    color: #ff4d4f !important;
}

.favorite-modal .favorite-folder-item .folder-count,
.favorite-folder-item .folder-count {
    font-size: 14px !important;
    color: #bbb !important;
    font-variant-numeric: tabular-nums !important;
    border: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: opacity 0.2s ease !important;
}

.favorite-modal .favorite-folder-item:hover .folder-count,
.favorite-folder-item:hover .folder-count {
    opacity: 0 !important;
}

/* 收藏按钮 - 悬停时显示 */
.favorite-modal .favorite-folder-item .folder-collect-btn,
.favorite-folder-item .folder-collect-btn {
    position: absolute !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 18px !important;
    background: #ff4d4f !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.2s ease, background 0.15s ease !important;
    box-shadow: none !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
}

.favorite-modal .favorite-folder-item:hover .folder-collect-btn,
.favorite-folder-item:hover .folder-collect-btn {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.favorite-modal .favorite-folder-item .folder-collect-btn:hover,
.favorite-folder-item .folder-collect-btn:hover {
    background: #e8393b !important;
}

.favorite-modal .favorite-folder-item .folder-collect-btn.is-cancel,
.favorite-folder-item .folder-collect-btn.is-cancel {
    background: #fff !important;
    color: #ff4d4f !important;
    border: 1px solid #ff4d4f !important;
}

.favorite-modal .favorite-folder-item .folder-collect-btn.is-cancel:hover,
.favorite-folder-item .folder-collect-btn.is-cancel:hover {
    background: #fff5f5 !important;
}

.favorite-modal .favorite-folder-item.is-in-folder .folder-collect-btn,
.favorite-folder-item.is-in-folder .folder-collect-btn {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.favorite-modal .favorite-folder-item.create-new,
.favorite-folder-item.create-new {
    color: #2196F3 !important;
    border: none !important;
    background: transparent !important;
    margin-top: 8px !important;
}

.favorite-modal .favorite-folder-item.create-new:hover,
.favorite-folder-item.create-new:hover {
    background: #f0f7ff !important;
}

.favorite-modal .favorite-folder-item.create-new:hover .folder-name,
.favorite-folder-item.create-new:hover .folder-name {
    color: #1976D2 !important;
}

.favorite-modal .favorite-folder-item.create-new .folder-name,
.favorite-folder-item.create-new .folder-name {
    color: #1976D2 !important;
    font-weight: 500 !important;
}

@media (max-width: 480px) {
    .favorite-modal-content {
        width: 100% !important;
        max-width: calc(100vw - 24px) !important;
        border-radius: 14px !important;
        min-height: 240px !important;
    }
    
    .favorite-modal-body {
        padding: 16px 20px 24px !important;
    }
}

/* 手机端收藏夹弹窗 - 直接显示收藏按钮替代数量 */
@media (max-width: 768px) {
    .favorite-modal .favorite-folder-item .folder-count,
    .favorite-folder-item .folder-count {
        display: none !important;
    }
    
    .favorite-modal .favorite-folder-item,
    .favorite-folder-item {
        padding: 12px 0 !important;
    }
    
    .favorite-modal .favorite-folder-item .folder-collect-btn,
    .favorite-folder-item .folder-collect-btn {
        position: relative !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        padding: 8px 20px !important;
        font-size: 14px !important;
        margin-left: auto !important;
        flex-shrink: 0 !important;
    }
}
