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

/* ✅ 白天模式（默认） */
:root,
[data-theme="light"] {
    --bg-base: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-card: #FFFFFF;
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --accent: #0EA5E9;
    --text-main: #1E293B;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --gold: #F59E0B;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-full: 100px;
    --border-subtle: rgba(0, 0, 0, 0.06);
    --shadow-neon: 0 4px 20px rgba(99, 102, 241, 0.15);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ✅ 黑夜模式 */
[data-theme="dark"] {
    --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);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
    --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(99, 102, 241, 0.08), transparent 50%),
        radial-gradient(ellipse at 85% 20%, rgba(14, 165, 233, 0.06), transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; transition: color 0.3s ease; }
img { display: block; max-width: 100%; }
button { 
    font: inherit; 
    cursor: pointer; 
    border: none; 
    background: none; 
    color: inherit;
    transition: all 0.3s ease;
}
input, textarea, select {
    font: inherit;
    transition: all 0.3s ease;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { 
    background: var(--text-muted); 
    border-radius: 10px;
    opacity: 0.3;
}
::-webkit-scrollbar-thumb:hover { 
    background: var(--primary); 
    opacity: 0.6;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(20px, 5vw, 80px);
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    z-index: 1000;
    transition: all 0.3s ease;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.logo i {
    font-size: 26px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-links a {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

.nav-links a:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.nav-links a.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.12);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
}

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

.search-box input {
    width: 100%;
    padding: 10px 18px 10px 44px;
    background: var(--bg-base);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
}

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

.search-box input:focus {
    background: var(--bg-surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

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

.search-box input:focus + i,
.search-box:focus-within > i {
    color: var(--primary);
}

/* ✅ 导航右侧区域 */
.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ✅ 主题切换按钮 */
.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-base);
    border: 2px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: rotate(180deg) scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.theme-toggle i {
    font-size: 20px;
    position: absolute;
    transition: all 0.3s ease;
}

/* 白天模式：显示月亮图标 */
[data-theme="light"] .theme-icon-light {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

[data-theme="light"] .theme-icon-dark {
    opacity: 1;
    transform: rotate(0) scale(1);
    color: #FBBF24;
}

/* 黑夜模式：显示太阳图标 */
[data-theme="dark"] .theme-icon-light {
    opacity: 1;
    transform: rotate(0) scale(1);
    color: #F59E0B;
}

[data-theme="dark"] .theme-icon-dark {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

/* ✅ 搜索联想下拉框 */
.search-box-wrapper {
    position: relative;
}

.search-box {
    position: relative;
    width: 300px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 0 16px;
    transition: all 0.3s var(--transition-smooth);
}

.search-box i {
    color: var(--text-muted);
    font-size: 18px;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
}

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

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
    background: var(--bg-surface);
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-suggestions.show {
    display: block;
    animation: slideDown 0.2s ease;
}

.search-suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-size: 14px;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
}

.search-suggestion-item .keyword {
    font-weight: 600;
    color: var(--primary);
}

.search-suggestion-item .meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Container ===== */
.container {
    padding: 92px clamp(20px, 5vw, 80px) 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;
    flex-wrap: wrap;  /* ✅ 允许自动折行 */
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 32px;
}

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

.tag {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s var(--transition-smooth);
    user-select: none;
}

.tag:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.tag.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: transparent;
    color: #FFFFFF;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

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

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

.section-title {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
}

.section-title::before {
    content: '';
    width: 4px;
    height: 22px;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.view-more {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.view-more:hover { 
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

/* ===== 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: all 0.4s var(--transition-bounce);
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-subtle);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-neon);
    border-color: rgba(99, 102, 241, 0.3);
}

.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(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px;
    transition: all 0.4s ease;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
}

.card:hover .card-overlay {
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0.98) 0%,
        rgba(99, 102, 241, 0.15) 100%);
    border-color: rgba(99, 102, 241, 0.2);
}

.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: 12px;
    left: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    backdrop-filter: blur(8px);
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #FFF;
}

/* ✅ 语种标签 */
.language-badges {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.lang-badge {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.rating {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

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

.card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #FFFFFF;
}

.card-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quality-tag {
    background: rgba(255, 255, 255, 0.15);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #FFFFFF;
    backdrop-filter: blur(4px);
}

/* ===== 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; }

/* ✅ 语言版本提示 */
.lang-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
    margin-top: 8px;
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    font-size: 13px;
    color: var(--primary);
    width: fit-content;
}

.lang-hint i {
    font-size: 14px;
}

/* ✅ 语言版本选择按钮 */
.lang-buttons {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lang-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-tertiary);
    opacity: 0.8;
}

.lang-label i {
    font-size: 14px;
}

.btn-lang {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 14px;
    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-lang:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

.btn-lang.active {
    color: #FFF;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent;
}

.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);
}

/* Expand Button for Episodes */
.expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    cursor: pointer;
    margin: 15px auto;
    color: var(--text-muted);
    font-size: 14px;
    transition: all 0.3s;
    max-width: 200px;
}

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

.expand-btn .arrow {
    font-size: 12px;
    transition: transform 0.3s;
}

/* 播放来源圆形按钮 */
.source-btn {
    position: relative;
    min-width: 44px;
    height: 44px;
    border-radius: 22px;
    background: rgba(30, 30, 40, 0.95) !important;
    border: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7) !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 14px !important;
    white-space: nowrap;
    overflow: hidden !important;
    z-index: 1;
    isolation: isolate;
    box-sizing: border-box;
}

/* 背后旋转光碟光晕 */
.source-btn::before {
    content: '' !important;
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100% + 12px);
    height: calc(100% + 12px);
    margin-top: calc(-50% - 6px);
    margin-left: calc(-50% - 6px);
    border-radius: 28px;
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        #ff6b6b 15%,
        #feca57 30%,
        #48dbfb 45%,
        #ff9ff3 60%,
        #54a0ff 75%,
        #5f27cd 90%,
        transparent 100%
    ) !important;
    opacity: 0;
    animation: rotate-disc 3s linear infinite;
    z-index: -2 !important;
    display: block !important;
    filter: blur(2px);
}

/* 内部高亮层 */
.source-btn::after {
    content: '' !important;
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-radius: 20px;
    background: rgba(30, 30, 40, 0.95) !important;
    z-index: -1 !important;
    display: block !important;
}

.source-btn:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    transform: scale(1.05);
}

.source-btn:hover::before {
    opacity: 0.4;
}

/* 选中状态 */
.source-btn.active {
    color: #FFF !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05)) !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2), inset 0 0 10px rgba(255, 255, 255, 0.1);
}

.source-btn.active::before {
    opacity: 0.8 !important;
    animation: rotate-disc 2s linear infinite !important;
    filter: blur(3px);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5), 0 0 40px rgba(72, 219, 251, 0.3);
}

@keyframes rotate-disc {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 播放来源提示文字 */
.source-tip {
    padding: 16px 20px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15) 0%, rgba(254, 202, 87, 0.15) 50%, rgba(72, 219, 251, 0.15) 100%);
    border: 2px solid rgba(255, 107, 107, 0.4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.95);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.source-tip::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2.5s infinite;
}

.source-tip i {
    font-size: 22px;
    color: #ff6b6b;
    animation: pulse 1.5s infinite;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(255, 107, 107, 0.6));
}

.source-tip span {
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff6b6b);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 2.5s ease infinite;
    font-weight: 600;
    font-size: 15px;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

/* ✅ 播放器上方提示区域 */
.play-tip-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    margin-bottom: 12px;
}

.tip-item {
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.tip-item i {
    font-size: 18px;
    flex-shrink: 0;
}

.tip-item span {
    flex: 1;
}

/* 警告提示（备用线路） */
.tip-warning {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 107, 107, 0.08));
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: rgba(255, 255, 255, 0.9);
}

.tip-warning i {
    color: #ff6b6b;
    animation: pulse 1.5s infinite;
}

/* 信息提示（播放列表） */
.tip-info {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.08));
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: rgba(255, 255, 255, 0.9);
}

.tip-info i {
    color: var(--accent);
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes gradient-shift {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

/* ===== 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: 64px;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom);
    transition: all 0.3s ease;
}

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

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

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

.tab-item:hover {
    color: var(--primary);
}

.tab-item.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.tab-item.active i {
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
    transform: translateY(-3px) scale(1.1);
}

.tab-item.active::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.7);
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s var(--transition-bounce);
}

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

@media (hover: hover) {
    .back-to-top:hover {
        background: var(--primary);
        border-color: var(--primary);
        box-shadow: 0 0 24px rgba(99, 102, 241, 0.3), 0 8px 20px rgba(0, 0, 0, 0.15);
        transform: translateY(-4px) scale(1.05);
    }
    
    .back-to-top:hover i {
        color: #FFFFFF;
    }
}

.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%;
    object-fit: contain;
    background: #000;
    pointer-events: none;
    z-index: 1;
    display: block;
}

/* ✅ 播放状态提示层 */
.play-tip-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 50;
    backdrop-filter: blur(4px);
}

.play-tip-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 48px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.play-tip-icon {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-tip-icon.spinning {
    animation: spin 1s linear infinite;
}

.play-tip-icon.error {
    color: #ff6b6b;
}

.play-tip-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.play-tip-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    max-width: 280px;
}

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

/* ✅ 当使用 iframe 模式时，强制隐藏 video */
.vp-inner iframe ~ .vp-video,
.vp-inner iframe ~ .vp-click-layer,
.vp-inner iframe ~ .vp-buffering,
.vp-inner iframe ~ .vp-big-play,
.vp-inner iframe ~ .vp-unmute-tip,
.vp-inner iframe ~ .vp-controls {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ✅ 备用解析 iframe 样式 */
.vp-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    z-index: 100;
    display: block;
    pointer-events: auto !important;
}

/* ✅ 内部 Toast 提示样式 */
.vp-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.vp-toast.visible {
    opacity: 1;
}

.vp-toast i {
    font-size: 18px;
    color: #00b894;
}

.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,
.player-wrap:-webkit-full-screen,
.player-wrap:-moz-full-screen,
.player-wrap:-ms-fullscreen { 
    background: #000; 
}
.player-wrap:fullscreen .vp-video,
.player-wrap:-webkit-full-screen .vp-video,
.player-wrap:-moz-full-screen .vp-video,
.player-wrap:-ms-fullscreen .vp-video { 
    object-fit: contain; 
}
.player-wrap:fullscreen .vp-controls,
.player-wrap:-webkit-full-screen .vp-controls,
.player-wrap:-moz-full-screen .vp-controls,
.player-wrap:-ms-fullscreen .vp-controls { 
    padding-bottom: 16px; 
}

/* ✅ 全屏时隐藏鼠标 - 覆盖所有子元素 */
/* 使用通配符选择器强制覆盖所有子元素的cursor样式 */
.player-wrap:fullscreen.hide-mouse,
.player-wrap:fullscreen.hide-mouse *,
.player-wrap:-webkit-full-screen.hide-mouse,
.player-wrap:-webkit-full-screen.hide-mouse *,
.player-wrap:-moz-full-screen.hide-mouse,
.player-wrap:-moz-full-screen.hide-mouse *,
.player-wrap:-ms-fullscreen.hide-mouse,
.player-wrap:-ms-fullscreen.hide-mouse * {
    cursor: none !important;
    pointer-events: auto !important; /* 确保鼠标事件正常工作 */
}

/* ✅ iframe模式下的全屏鼠标隐藏 */
/* iframe内部的鼠标样式由外部网站控制，通过容器层捕获鼠标事件 */
/* 不设置pointer-events: none，确保iframe可以正常接收用户交互 */
.player-wrap:fullscreen.hide-mouse iframe,
.player-wrap:-webkit-full-screen.hide-mouse iframe,
.player-wrap:-moz-full-screen.hide-mouse iframe,
.player-wrap:-ms-fullscreen.hide-mouse iframe {
    cursor: none !important;
    /* 不使用pointer-events: none，确保进度条等交互正常 */
}

/* ✅ iframe鼠标捕获层 - 全屏隐藏鼠标时显示，用于检测鼠标移动 */
.iframe-mouse-catcher {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: none !important;
    z-index: 1000;
    /* 透明，不影响视觉 */
    background: transparent;
    /* 只在需要时捕获事件 */
    pointer-events: auto;
}

/* ---- 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: 1024px) and (min-width: 769px) {
    /* ✅ 平板设备：自动折行 */
    .categories {
        flex-wrap: wrap;
    }
}

@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; }

    /* ✅ 移动端分类标签：自动折行 */
    .categories {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .tag {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* 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; }
}
