/* ========================================
   Cloud Theme - 影视站点主题
   ======================================== */

/* CSS Variables */
:root {
    --bg-primary: #0b0f14;
    --bg-secondary: #131820;
    --bg-tertiary: #1a202c;
    --bg-card: #1e2533;
    --bg-hover: #252d3d;
    
    --text-primary: #e4e8f0;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    
    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    
    --border-color: #2d3748;
    --border-light: #4a5568;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-light: #cbd5e1;
    
    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ========================================
   Header & Navigation
   ======================================== */
.cloud-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(11, 15, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .cloud-header {
    background: rgba(255, 255, 255, 0.95);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 30px;
}

/* Logo */
.cloud-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.cloud-logo img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    object-fit: contain;
}

.cloud-logo span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation */
.cloud-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cloud-nav a {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}

.cloud-nav a:hover,
.cloud-nav a.active {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.cloud-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 2px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   Search Box - Redesigned
   ======================================== */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 200px;
    height: 44px;
    padding: 0 50px 0 18px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 4px 12px rgba(99, 102, 241, 0.2);
}

.search-input::placeholder {
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.search-input:focus::placeholder {
    opacity: 0.5;
    transform: translateX(6px);
}

.search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.1) rotate(5deg);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
}

.search-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.search-btn svg {
    width: 15px;
    height: 15px;
    stroke-width: 2.5;
}

/* ========================================
   Hero Section - Compact
   ======================================== */
.cloud-hero {
    padding: 28px 0 18px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 14px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero Search - Redesigned */
.hero-search {
    max-width: 600px;
    margin: 0 auto 16px;
    position: relative;
}

.hero-search-wrapper {
    position: relative;
    background: var(--bg-card);
    border-radius: 30px;
    padding: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-search-wrapper:focus-within {
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.25), 0 0 0 2px var(--accent-primary);
    transform: translateY(-2px);
}

.hero-search .search-input {
    width: 100%;
    height: 50px;
    padding: 0 64px 0 22px;
    font-size: 1rem;
    border-radius: 25px;
    border: none;
    background: transparent;
}

.hero-search .search-input:focus {
    width: 100%;
    box-shadow: none;
}

.hero-search .search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-gradient);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.hero-search .search-btn:hover {
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.hero-search .search-btn svg {
    width: 18px;
    height: 18px;
}

/* Hot Tags */
.hot-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.hot-tags span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.hot-tags a {
    padding: 5px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.hot-tags a:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ========================================
   Content Sections - Compact
   ======================================== */
.cloud-section {
    padding: 16px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 3px;
    height: 18px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.section-more {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

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

/* Subcategories */
.section-subcats {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.section-subcats a {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    transition: var(--transition);
    text-decoration: none;
}

.section-subcats a:hover {
    background: var(--accent-primary);
    color: white;
}

.section-subcats .section-more {
    background: transparent;
    padding: 4px 8px;
    color: var(--text-muted);
}

.section-subcats .section-more:hover {
    color: var(--accent-primary);
    background: transparent;
}

/* ========================================
   Video Cards - Fixed Size Layout
   ======================================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    justify-content: start;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* PC: 6 cards per row */
.video-card {
    background: transparent;
    transition: var(--transition);
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.video-cover {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 133%;
    overflow: hidden;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    display: block;
    box-sizing: border-box;
}

.video-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: var(--transition);
    display: block;
}

.video-card:hover .video-cover img {
    transform: scale(1.05);
}

.video-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    color: white;
    z-index: 2;
}

.video-badge.hot {
    background: rgba(239, 68, 68, 0.9);
}

.video-badge.new {
    background: rgba(34, 197, 94, 0.9);
}

.video-score {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fbbf24;
    z-index: 2;
}

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}

.video-play-icon svg {
    width: 24px;
    height: 24px;
    color: white;
    margin-left: 3px;
}

.video-card:hover .video-play-icon {
    opacity: 1;
}

.video-info {
    padding: 8px 4px 0;
    width: 100%;
}

.video-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-actor {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.video-year {
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

/* ========================================
   Category Tabs
   ======================================== */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

.category-tab:hover,
.category-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* ========================================
   Dropdown Menus
   ======================================== */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.dropdown-menu a:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet & Mobile: 3 cards per row */
@media (max-width: 992px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        justify-content: start;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .video-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .video-cover {
        width: 100%;
        height: 0;
        padding-top: 133%;
    }
    
    .video-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    .video-info {
        width: 100%;
    }
    
    .video-title {
        font-size: 0.8rem;
    }
    
    .video-actor {
        font-size: 0.7rem;
    }
    
    .video-badge,
    .video-score {
        font-size: 0.6rem;
        padding: 3px 6px;
    }
    
    .video-play-icon {
        width: 36px;
        height: 36px;
    }
    
    .video-play-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .cloud-section {
        padding: 14px 0;
    }
    
    .section-header {
        margin-bottom: 10px;
        padding-bottom: 6px;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        justify-content: start;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .video-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .video-cover {
        width: 100%;
        height: 0;
        padding-top: 133%;
    }
    
    .video-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    .video-info {
        width: 100%;
    }
    
    .cloud-hero {
        padding: 20px 0 14px;
    }
    
    .hero-title {
        font-size: 1.4rem;
        margin-bottom: 12px;
    }
    
    .hero-search {
        margin-bottom: 12px;
    }
    
    .hero-search-wrapper {
        padding: 4px;
        border-radius: 26px;
    }
    
    .hero-search .search-input {
        height: 44px;
        font-size: 0.9rem;
        padding: 0 54px 0 18px;
        border-radius: 22px;
    }
    
    .hero-search .search-btn {
        width: 34px;
        height: 34px;
        right: 10px;
    }
    
    .hero-search .search-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .hot-tags {
        margin-top: 10px;
        gap: 6px;
    }
    
    .hot-tags a {
        padding: 4px 10px;
        font-size: 0.75rem;
    }
    
    .cloud-section {
        padding: 12px 0;
    }
    
    .section-header {
        margin-bottom: 10px;
        padding-bottom: 6px;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .section-subcats {
        display: none;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .video-badge,
    .video-score {
        font-size: 0.6rem;
        padding: 2px 5px;
    }
    
    .video-info {
        padding: 6px 2px 0;
    }
    
    .video-title {
        font-size: 0.75rem;
        margin-bottom: 2px;
    }
    
    .video-actor {
        font-size: 0.65rem;
    }
    
    .search-input {
        width: 160px;
        height: 40px;
        font-size: 0.85rem;
    }
    
    .search-input:focus {
        width: 200px;
    }
    
    .search-btn {
        width: 28px;
        height: 28px;
    }
    
    .search-btn svg {
        width: 13px;
        height: 13px;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        justify-content: start;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .video-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .video-cover {
        width: 100%;
        height: 0;
        padding-top: 133%;
    }
    
    .video-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    .video-info {
        width: 100%;
    }
    
    .hero-title {
        font-size: 1.2rem;
    }
    
    .hero-search .search-input {
        height: 40px;
        font-size: 0.85rem;
    }
    
    .hero-search .search-btn {
        width: 30px;
        height: 30px;
    }
    
    .cloud-section {
        padding: 10px 0;
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.hidden { display: none; }
.visible { display: block; }
