﻿/* ========================================
   Vibrant Gradient Theme - Components
   components.css - Cards, buttons, badges, pagination, tags
   ======================================== */

/* === Video Card (shared between home, category, detail) === */
.tp4-item-cover {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: var(--tp4-radius);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.tp4-item-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.tp4-item-cover:hover img {
    transform: scale(1.05);
}

.tp4-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 8px;
    display: flex;
    justify-content: flex-end;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}

.tp4-duration {
    font-size: 11px;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.tp4-item-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.tp4-item-texts {
    padding: 8px 0 4px;
}

.tp4-item-texts h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--tp4-text-primary);
    margin: 0 0 4px;
    line-height: 1.4;
}

.tp4-text-social {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tp4-eye {
    font-size: 11px;
    color: var(--tp4-text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}

.tp4-eye::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238686a0' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Tags */
.tp4-tag-items {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.tp4-tag-item {
    display: inline-block;
}

.tp4-tag-item span {
    display: inline-block;
    font-size: 11px;
    color: var(--tp4-accent);
    background: rgba(240, 147, 251, 0.1);
    border: 1px solid rgba(240, 147, 251, 0.2);
    padding: 1px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--tp4-transition);
}

.tp4-tag-item span:hover {
    background: rgba(240, 147, 251, 0.2);
    border-color: rgba(240, 147, 251, 0.4);
    color: #fff;
}

/* Buttons */
.tp4-more-btn {
    background: var(--tp4-gradient-primary);
    color: #fff;
    border: none;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--tp4-transition);
}

.tp4-more-btn:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

/* Toggle / Prev-Next buttons */
.tp4-toggle {
    background: var(--tp4-bg-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--tp4-border);
    color: var(--tp4-text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--tp4-transition);
    flex-shrink: 0;
}

.tp4-toggle:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: var(--tp4-accent-alt);
    color: #fff;
}

.tp4-toggle.prev::before {
    content: "\2039";
    font-size: 20px;
    line-height: 1;
}

.tp4-toggle.next::before {
    content: "\203A";
    font-size: 20px;
    line-height: 1;
}

/* Pagination */
.tp4-pagination-nav {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

.tp4-pagination {
    list-style: none;
    display: flex;
    gap: 4px;
    padding: 0;
    margin: 0;
    align-items: center;
}

.tp4-page-item {
    display: inline-flex;
}

.tp4-page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: var(--tp4-radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--tp4-text-secondary);
    background: var(--tp4-bg-card);
    border: 1px solid var(--tp4-border);
    transition: var(--tp4-transition);
    text-decoration: none;
    cursor: pointer;
}

a.tp4-page-link:hover {
    color: #fff;
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--tp4-accent-alt);
}

.tp4-current .tp4-page-link {
    background: var(--tp4-gradient-primary);
    color: #fff;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.tp4-page-ellipsis {
    background: transparent;
    border-color: transparent;
    cursor: default;
}

/* Scroll containers (ad banners) */
.tp4-scroll-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 12px 0;
    max-width: 100%;
}

.tp4-scroll-container::-webkit-scrollbar {
    display: none;
}

.tp4-scroll-wrapper {
    display: flex;
    gap: 10px;
    padding: 4px 0;
}

.tp4-card-box,
.tp4-pc-card-box {
    flex-shrink: 0;
    width: 80px;
    text-align: center;
    text-decoration: none;
}

.tp4-card-box img,
.tp4-pc-card-box img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--tp4-radius-sm);
    object-fit: cover;
}

.tp4-card-title,
.tp4-pc-card-title {
    font-size: 11px;
    color: var(--tp4-text-secondary);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp4-pc-card-box {
    display: none;
}

@media screen and (min-width: 825px) {
    .tp4-card-box {
        display: none;
    }
    .tp4-pc-card-box {
        display: block;
        width: 100px;
    }
}

/* Info row (ad banner grid) */
.tp4-info-row-wrap {
    padding: 8px 0;
}

.tp4-info-row-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0;
    margin: 0;
}

@media screen and (max-width: 824px) {
    .tp4-info-row-list {
        grid-template-columns: 1fr;
    }

}

/* Top and banners */
.tp4-top-and-banners {
    padding: 16px 0;
    position: relative;
}

.tp4-top-and-banners-cols {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0;
    margin: 0;
}

.tp4-top-and-banners-cols li {
    height: var(--ad-slot-strip-li-h, 6.875rem);
}

@media screen and (min-width: 825px) {
    .tp4-top-and-banners {
        padding: 24px 0;
    }

    .tp4-top-and-banners-cols {
        gap: 12px;
    }

    .tp4-top-and-banners-cols li {
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    .tp4-top-and-banners-cols li .banner-cover,
    .tp4-top-and-banners-cols li .tp4-banner-cover {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        height: 100%;
        position: relative;
        overflow: hidden;
    }

    .tp4-top-and-banners-cols li .banner-cover img,
    .tp4-top-and-banners-cols li .tp4-banner-cover img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        object-fit: fill;
        object-position: center;
        display: block;
        cursor: pointer;
        transition: transform 0.3s;
    }

    .tp4-top-and-banners-cols li .banner-cover img:hover,
    .tp4-top-and-banners-cols li .tp4-banner-cover img:hover {
        transform: scale(1.03);
    }
}

.tp4-banner-cover {
    overflow: hidden;
    height: 100%;
}

.tp4-banner-cover img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    cursor: pointer;
    transition: transform 0.3s;
}

.tp4-banner-cover img:hover {
    transform: scale(1.03);
}

.tp4-back-top-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--tp4-gradient-primary);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--tp4-transition);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tp4-back-top-btn:hover {
    transform: scale(1.1);
}

.tp4-back-top-btn svg {
    width: 20px;
    height: 20px;
}

@media screen and (max-width: 824px) {
    .tp4-top-and-banners-cols {
        grid-template-columns: repeat(1, 1fr);
        align-items: stretch;
        gap: 4px;
    }

    .tp4-top-and-banners-cols li {
        height: var(--ad-slot-strip-li-h-sm, 2.8125rem);
        min-height: var(--ad-slot-strip-li-h-sm, 2.8125rem);
        position: relative;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    /* 移动端：行高由 li 决定，取消 common 里 banner-cover 的宽高比，让图随格拉伸/压缩 */
    .tp4-top-and-banners-cols li .banner-cover {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        height: 100%;
        aspect-ratio: unset !important;
        position: relative;
        overflow: hidden;
    }

    .tp4-top-and-banners-cols li .banner-cover img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        object-fit: fill;
        object-position: center;
        display: block;
    }
}

/* Scroll top button */
.tp4-scroll-top {
    position: fixed;
    top: 70%;
    right: 25px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--tp4-gradient-primary);
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: var(--tp4-transition);
}

.tp4-scroll-top::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 15l-6-6-6 6'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.tp4-scroll-top:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.5);
}

@media screen and (max-width: 824px) {
    .tp4-scroll-top {
        right: 16px;
        width: 42px;
        height: 42px;
    }
}
