/* ============================================
   NewCloud TV — 免费沉浸式影视 · 全局样式
   ============================================ */

:root {
    --bg-base: #05050A;
    --bg-surface: #0C0C16;
    --bg-card: #12121C;
    --primary: #8B5CF6;
    --primary-dark: #6D28D9;
    --accent: #06B6D4;
    --text-main: #FFFFFF;
    --text-secondary: #CBD5E1;
    --text-muted: #64748B;
    --gold: #FBBF24;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-full: 100px;
    --border-subtle: rgba(255, 255, 255, 0.04);
    --shadow-neon: 0 0 30px rgba(139, 92, 246, 0.25);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ===== Reset ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-base);
    background-image:
        radial-gradient(ellipse at 15% 50%, rgba(139, 92, 246, 0.06), transparent 50%),
        radial-gradient(ellipse at 85% 20%, rgba(6, 182, 212, 0.05), transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1E293B; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(16px, 4vw, 60px);
    background: rgba(5, 5, 10, 0.8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
}

.logo {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #A78BFA, #22D3EE);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    flex-shrink: 0;
}

.logo i {
    background: linear-gradient(135deg, #A78BFA, #22D3EE);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
    transition: color 0.3s;
    position: relative;
    padding: 6px 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
}

.search-box {
    position: relative;
    width: 240px;
}

.search-box input {
    width: 100%;
    padding: 9px 16px 9px 40px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    color: #FFF;
    font-size: 13px;
    outline: none;
    transition: all 0.3s;
}

.search-box input::placeholder { color: var(--text-muted); }

.search-box input:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(139, 92, 246, 0.35);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.12);
}

.search-box > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
}

/* ===== Container ===== */
.container {
    padding: 88px clamp(16px, 4vw, 60px) 40px;
    max-width: 1600px;
    margin: 0 auto;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.breadcrumb a { transition: color 0.3s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: 0.3; }
.breadcrumb .current { color: var(--text-secondary); }

/* ===== Categories (顶部分类标签) ===== */
.categories {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 32px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories::-webkit-scrollbar { display: none; }

.tag {
    padding: 7px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s var(--transition-smooth);
    user-select: none;
}

.tag:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
}

.tag.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(6, 182, 212, 0.18));
    border-color: rgba(139, 92, 246, 0.35);
    color: var(--text-main);
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.12);
}

/* ===== Section ===== */
.section {
    margin-bottom: 48px;
}

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

.section-title {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 3px;
    height: 18px;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
    border-radius: 3px;
    flex-shrink: 0;
}

.view-more {
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.3s;
}

.view-more:hover { color: var(--primary); }

/* ===== Grid ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* ===== Card ===== */
.card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 2 / 3;
    cursor: pointer;
    display: block;
    transition: transform 0.5s var(--transition-bounce), box-shadow 0.5s ease;
    background: var(--bg-card);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.card-poster {
    position: absolute;
    inset: 0;
    transition: transform 0.6s ease, filter 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
}

.card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-poster::after {
    content: '\eafe';
    font-family: 'remixicon';
    font-size: 44px;
    color: rgba(255, 255, 255, 0.04);
    position: absolute;
    z-index: -1;
}

.card:hover .card-poster {
    transform: scale(1.08);
    filter: brightness(1.15);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
        rgba(5, 5, 10, 0.97) 0%,
        rgba(5, 5, 10, 0.35) 50%,
        transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    transition: background 0.4s ease;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
}

.card:hover .card-overlay {
    background: linear-gradient(to top,
        rgba(5, 5, 10, 1) 0%,
        rgba(139, 92, 246, 0.2) 100%);
    border-color: rgba(139, 92, 246, 0.25);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px -12px rgba(139, 92, 246, 0.35), 0 0 20px rgba(6, 182, 212, 0.08);
}

.play-btn {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFF;
    font-size: 22px;
    transition: all 0.45s var(--transition-bounce);
    z-index: 2;
}

.card:hover .play-btn {
    opacity: 1;
    top: 50%;
    transform: translate(-50%, -50%) scale(1);
    background: var(--primary);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 28px rgba(139, 92, 246, 0.55);
}

.badge-top-left {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(139, 92, 246, 0.85);
    backdrop-filter: blur(6px);
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #FFF;
    z-index: 2;
}

.rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 3px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 2;
}

.card-info {
    position: relative;
    z-index: 1;
    transform: translateY(6px);
    transition: transform 0.4s ease;
}

.card:hover .card-info { transform: translateY(0); }

.card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quality-tag {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

/* ===== Filters (list.php 顶部筛选) ===== */
.filter-section {
    margin-bottom: 28px;
}

.filter-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.filter-row:last-child { border-bottom: none; }

.filter-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    padding-top: 5px;
    flex-shrink: 0;
    width: 48px;
}

.filter-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    padding: 2px 0;
}

.filter-scroll::-webkit-scrollbar { display: none; }

.filter-item {
    padding: 5px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s;
    border: 1px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-item:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
}

.filter-item.active {
    color: var(--text-main);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.15));
    border-color: rgba(139, 92, 246, 0.3);
}

.result-info {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.result-info em {
    color: var(--accent);
    font-weight: 600;
    font-style: normal;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 48px;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0 4px;
}

.page-btn:hover:not(.dots) {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: transparent;
    color: #FFF;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.page-btn.dots {
    background: transparent;
    border: none;
    cursor: default;
    pointer-events: none;
}

/* ===== Detail Page ===== */
.detail-hero {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.detail-poster {
    flex-shrink: 0;
    width: 260px;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: 0 16px 48px -12px rgba(139, 92, 246, 0.3);
}

.detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-poster-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-poster-bg::after {
    content: '\eafe';
    font-family: 'remixicon';
    font-size: 56px;
    color: rgba(255, 255, 255, 0.05);
}

.detail-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    min-width: 0;
}

.detail-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
}

.detail-subtitle {
    font-size: 15px;
    color: var(--text-muted);
}

.detail-rating-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.detail-score {
    font-size: 40px;
    font-weight: 900;
    background: linear-gradient(135deg, #FBBF24, #F59E0B);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.detail-stars {
    display: flex;
    gap: 3px;
    color: var(--gold);
    font-size: 18px;
}

.detail-stars .dim { color: rgba(251, 191, 36, 0.2); }

.detail-votes {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-tag {
    padding: 5px 16px;
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s;
}

.detail-tag:hover {
    color: var(--text-main);
    border-color: rgba(139, 92, 246, 0.25);
}

.meta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    word-break: break-all;
    font-size: 13px;
    color: var(--text-muted);
}

.meta-grid strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.detail-actions {
    display: flex;
    gap: 14px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.btn-play {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 32px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    color: #FFF;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
    transition: all 0.4s var(--transition-bounce);
}

.btn-play:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(139, 92, 246, 0.45);
}

.btn-play i { font-size: 20px; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: all 0.3s;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

/* Synopsis */
.glass-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
}

.block-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.block-title i { color: var(--primary); font-size: 20px; }

.synopsis-text {
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-muted);
}

/* Episode Grid */
.ep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
}

.ep-btn {
    width: 100%;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
}

.ep-btn:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.35);
    color: var(--text-main);
}

.ep-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: transparent;
    color: #FFF;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

/* ===== Play Page ===== */
.player-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 60px -16px rgba(0, 0, 0, 0.8);
}

.player-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
}

.player-placeholder i {
    font-size: 64px;
    color: var(--primary);
    opacity: 0.6;
}

.player-placeholder span { font-size: 15px; }

.play-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.play-now-title {
    font-size: 20px;
    font-weight: 700;
}

.play-now-title span {
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    margin-left: 8px;
}

.play-toolbar {
    display: flex;
    gap: 8px;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.tool-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
}

/* ===== Search Page ===== */
.search-hero {
    text-align: center;
    padding: 20px 0 36px;
}

.search-hero h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 20px;
}

.search-big-input {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
}

.search-big-input input {
    width: 100%;
    padding: 14px 24px 14px 50px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    color: #FFF;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
}

.search-big-input input::placeholder { color: var(--text-muted); }

.search-big-input input:focus {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.15);
}

.search-big-input > i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-stats {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.search-stats em {
    color: var(--accent);
    font-style: normal;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.3;
    display: block;
}

/* ===== Footer ===== */
.site-footer {
    text-align: center;
    padding: 36px clamp(16px, 4vw, 60px) 28px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 60px;
}

.footer-brand {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, #A78BFA, #22D3EE);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.footer-brand i {
    background: linear-gradient(135deg, #A78BFA, #22D3EE);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-bottom: 14px;
}

.footer-nav a {
    color: var(--text-muted);
    font-size: 13px;
    transition: color 0.3s;
}

.footer-nav a:hover { color: var(--text-main); }

.footer-copy {
    font-size: 12px;
    color: rgba(100, 116, 139, 0.5);
}

/* ===== Mobile Bottom Tab Bar ===== */
.mobile-tabbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(5, 5, 10, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 1000;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom);
}

.tabbar-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    max-width: 500px;
    margin: 0 auto;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 12px;
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.tab-item i {
    font-size: 22px;
    transition: all 0.3s var(--transition-bounce);
}

.tab-item.active {
    color: var(--text-main);
}

.tab-item.active i {
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.6));
    transform: translateY(-2px);
}

.tab-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(12, 12, 22, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: opacity 0.4s, visibility 0.4s, transform 0.4s var(--transition-bounce),
                background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

@media (hover: hover) {
    .back-to-top:hover {
        background: rgba(139, 92, 246, 0.15);
        border-color: rgba(139, 92, 246, 0.5);
        box-shadow: 0 0 24px rgba(139, 92, 246, 0.25), 0 8px 20px rgba(0, 0, 0, 0.3);
        transform: translateY(-3px) scale(1);
    }
}

.back-to-top:active {
    transform: translateY(0) scale(0.95);
}

.back-to-top i {
    font-size: 20px;
    background: linear-gradient(135deg, #A78BFA, #22D3EE);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.3s;
}

@media (hover: hover) {
    .back-to-top:hover i {
        transform: translateY(-2px);
    }
}

.back-to-top .btt-ring {
    position: absolute;
    inset: -1px;
    border-radius: 14px;
    border: 2px solid transparent;
    background: conic-gradient(from 0deg, var(--primary), var(--accent), transparent 70%) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
}

@media (hover: hover) {
    .back-to-top:hover .btt-ring {
        opacity: 1;
    }
}

/* ===== Custom Video Player ===== */
.vp-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
    object-fit: contain;
    pointer-events: none;
}

.vp-loading, .vp-buffering {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    color: rgba(255,255,255,.7);
    font-size: 13px;
    pointer-events: none;
    gap: 12px;
}

.vp-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.15);
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

/* Click detection layer */
.vp-click-layer {
    position: absolute;
    inset: 0;
    z-index: 4;
    cursor: pointer;
}

.vp-big-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
    pointer-events: auto;
    cursor: pointer;
}
.vp-big-play i {
    font-size: 52px;
    color: #fff;
    background: rgba(139,92,246,.65);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 4px;
    box-shadow: 0 4px 24px rgba(139,92,246,.4);
    transition: transform .2s, background .2s;
}

/* Unmute tip */
.vp-unmute-tip {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    background: rgba(139,92,246,.85);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 13px;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(139,92,246,.3);
    animation: unmutePulse 2s ease infinite;
    white-space: nowrap;
}
@keyframes unmutePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .7; }
}

/* Long press speed indicator */
.vp-speed-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 12;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 24px;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vp-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: linear-gradient(transparent, rgba(0,0,0,.85));
    padding: 24px 16px 12px;
    opacity: 0;
    transition: opacity .3s;
}
.vp-controls.visible { opacity: 1; }

.vp-progress {
    position: relative;
    height: 20px;
    cursor: pointer;
    margin-bottom: 6px;
    touch-action: none;
    display: flex;
    align-items: center;
}
.vp-progress::before {
    content: '';
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    background: rgba(255,255,255,.15);
    border-radius: 2px;
    transition: height .15s;
}
.vp-progress:hover::before,
.vp-progress:active::before { height: 6px; }

.vp-progress-buffered {
    position: absolute;
    top: 50%;
    left: 0;
    height: 4px;
    transform: translateY(-50%);
    background: rgba(255,255,255,.2);
    border-radius: 2px;
    pointer-events: none;
    transition: height .15s;
}
.vp-progress-played {
    position: absolute;
    top: 50%;
    left: 0;
    height: 4px;
    transform: translateY(-50%);
    background: var(--primary);
    border-radius: 2px;
    pointer-events: none;
    transition: height .15s;
}
.vp-progress:hover .vp-progress-buffered,
.vp-progress:active .vp-progress-buffered { height: 6px; }
.vp-progress:hover .vp-progress-played,
.vp-progress:active .vp-progress-played { height: 6px; }

.vp-progress-thumb {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border: 2px solid #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity .15s;
    pointer-events: none;
    box-shadow: 0 0 6px rgba(139,92,246,.5);
    z-index: 2;
}
.vp-progress:hover .vp-progress-thumb,
.vp-progress:active .vp-progress-thumb { opacity: 1; }

.vp-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.vp-controls-left, .vp-controls-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vp-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background .15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vp-btn:hover { background: rgba(255,255,255,.12); }

.vp-text-btn {
    font-size: 13px !important;
    font-weight: 500;
    padding: 4px 10px;
    letter-spacing: .3px;
}

.vp-time {
    font-size: 12px;
    color: rgba(255,255,255,.75);
    margin-left: 8px;
    font-variant-numeric: tabular-nums;
    user-select: none;
}

/* ---- Popup Menus (speed / quality / fit) ---- */
.vp-menu-wrap { position: relative; }

.vp-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
    background: rgba(18, 18, 30, .95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 6px;
    min-width: 90px;
    z-index: 20;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
}

.vp-popup-title {
    font-size: 11px;
    color: rgba(255,255,255,.35);
    padding: 4px 12px 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
    user-select: none;
}

.vp-popup-item {
    padding: 7px 16px;
    font-size: 13px;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    border-radius: 6px;
    white-space: nowrap;
    text-align: center;
    transition: background .15s, color .15s;
}
.vp-popup-item:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}
.vp-popup-item.active {
    color: var(--primary);
    font-weight: 600;
}

/* ---- Volume Slider ---- */
.vp-volume-wrap {
    display: flex;
    align-items: center;
    position: relative;
}
.vp-volume-slider {
    width: 0;
    overflow: hidden;
    transition: width .25s ease;
    display: flex;
    align-items: center;
}
.vp-volume-wrap:hover .vp-volume-slider,
.vp-volume-wrap.expanded .vp-volume-slider {
    width: 80px;
    padding-right: 4px;
}

.vp-vol-range {
    -webkit-appearance: none;
    appearance: none;
    width: 76px;
    height: 4px;
    background: rgba(255,255,255,.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.vp-vol-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(139,92,246,.5);
}
.vp-vol-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--primary);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(139,92,246,.5);
}

/* ---- Progress Hover Tooltip ---- */
.vp-progress-tip {
    position: absolute;
    bottom: 100%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    background: rgba(0,0,0,.85);
    color: #fff;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ---- Fullscreen Top Bar ---- */
.vp-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: linear-gradient(rgba(0,0,0,.85), transparent);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}
.vp-top-bar.visible {
    opacity: 1;
    pointer-events: auto;
}
.vp-top-title {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Mobile tap highlight fix ---- */
.player-wrap,
.player-wrap *,
.vp-click-layer,
.vp-controls,
.vp-controls *,
.vp-top-bar,
.vp-top-bar *,
.vp-big-play,
.vp-unmute-tip {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* ---- Fullscreen ---- */
.player-wrap:fullscreen { background: #000; }
.player-wrap:fullscreen .vp-video { object-fit: contain; }
.player-wrap:fullscreen .vp-controls { padding-bottom: 16px; }

/* ---- Inner wrapper (for portrait rotation) ---- */
.vp-inner {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

/* ---- Portrait mode (fullscreen) ---- */
/* Rotate a single wrapper — all children (video, controls, overlays) rotate together */
.player-wrap:fullscreen.is-portrait {
    overflow: hidden;
}
.player-wrap:fullscreen.is-portrait .vp-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vh;
    height: 100vw;
    transform: translate(-50%, -50%) rotate(-90deg);
}

/* ---- tool-btn as button ---- */
button.tool-btn {
    background: none;
    border: 1px solid rgba(255,255,255,.1);
    cursor: pointer;
}

/* ===== Skeleton Loading ===== */
@keyframes skeleton-pulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.04) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.8s ease-in-out infinite;
    border-radius: var(--radius-md);
}

.skeleton-card {
    aspect-ratio: 2 / 3;
    border-radius: var(--radius-md);
}

.skeleton-tag {
    height: 32px;
    width: 72px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.skeleton-title {
    height: 24px;
    width: 120px;
    border-radius: 6px;
}

.skeleton-text {
    height: 16px;
    border-radius: 4px;
}

/* Loading overlay for sections */
.section-loading {
    position: relative;
    min-height: 200px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.loading-spinner::before {
    content: '';
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(139, 92, 246, 0.1);
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Fade in when data arrives */
.fade-in { animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
}

@media (max-width: 768px) {
    .navbar { padding: 0 16px; height: 56px; }
    .nav-links { display: none; }
    .search-box { width: 160px; }
    .container { padding-top: 72px; padding-bottom: 80px; }

    /* Show mobile tab bar */
    .mobile-tabbar { display: block; }

    /* Back to top above tab bar */
    .back-to-top { bottom: 76px; right: 16px; width: 40px; height: 40px; border-radius: 12px; }
    .back-to-top i { font-size: 18px; }
    .back-to-top .btt-ring { border-radius: 12px; }

    .grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .card-overlay { padding: 10px; }
    .card-title { font-size: 12px; }
    .card-meta { font-size: 10px; }
    .play-btn { width: 40px; height: 40px; font-size: 18px; }
    .section-title { font-size: 17px; }

    /* Detail responsive */
    .detail-hero { flex-direction: column; align-items: center; text-align: center; gap: 24px; }
    .detail-poster { width: 180px; }
    .detail-title { font-size: 22px; }
    .detail-rating-row { justify-content: center; }
    .detail-tags { justify-content: center; }
    .detail-actions { justify-content: center; }
    .meta-grid { grid-template-columns: 1fr 1fr; text-align: left; }

    /* Footer above tabbar */
    .site-footer { padding-bottom: 72px; }

    /* Filter mobile: horizontal scroll */
    .filter-row { flex-wrap: nowrap; }
    .filter-label { width: auto; padding-top: 6px; }
}

@media (max-width: 480px) {
    .grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .card-title { font-size: 11px; margin-bottom: 2px; }
    .rating { font-size: 10px; padding: 2px 5px; top: 6px; right: 6px; }
    .badge-top-left { font-size: 10px; padding: 2px 8px; top: 6px; left: 6px; }
    .play-btn { width: 34px; height: 34px; font-size: 16px; }
    .detail-poster { width: 140px; }
    .detail-title { font-size: 20px; }
    .btn-play { padding: 10px 24px; font-size: 14px; }
    .btn-ghost { padding: 10px 18px; font-size: 14px; }
}
