/* 视频壁纸站 - 前台样式 */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-hover: #1f2b4d;
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-gradient: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 50%, #fd79a8 100%);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-light);
}

.header-search {
    flex: 1;
    max-width: 400px;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-form input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.search-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.search-form input::placeholder {
    color: var(--text-muted);
}

/* Hero */
.hero {
    position: relative;
    padding: 60px 20px 40px;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0.08;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

.hero-content {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 12px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 32px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-light);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Category Nav */
.category-nav {
    padding: 0 20px 24px;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.category-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.category-tag {
    flex-shrink: 0;
    padding: 8px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.category-tag:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.category-tag.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px 60px;
    width: 100%;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.video-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(108, 92, 231, 0.3);
}

.card-media {
    position: relative;
    aspect-ratio: 9 / 16;
    background: #000;
    overflow: hidden;
    cursor: pointer;
}

.card-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.card-media:hover .card-overlay {
    opacity: 1;
}

.play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.play-btn svg {
    width: 24px;
    height: 24px;
    margin-left: 3px;
}

.play-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.1);
}

.card-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.card-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.card-info {
    padding: 16px;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-preview {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-preview:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-download {
    background: var(--accent);
    color: #fff;
}

.btn-download:hover {
    background: var(--accent-light);
    color: #fff;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
    border-radius: 12px;
}

.btn-lg svg {
    width: 20px;
    height: 20px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
}

.page-btn {
    padding: 10px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.page-btn:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.page-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 20px;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: scale(0.95) translateY(20px);
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-video-wrap {
    aspect-ratio: 9 / 16;
    background: #000;
    max-height: 60vh;
}

.modal-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.modal-info {
    padding: 24px;
    text-align: center;
}

.modal-info h2 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.modal-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner {
        height: 56px;
        padding: 0 16px;
    }

    .logo span {
        display: none;
    }

    .header-search {
        max-width: none;
    }

    .hero {
        padding: 40px 16px 24px;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat-num {
        font-size: 1.25rem;
    }

    .category-nav {
        padding: 0 16px 16px;
    }

    .main-content {
        padding: 0 16px 40px;
    }

    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .card-info {
        padding: 12px;
    }

    .card-title {
        font-size: 0.85rem;
    }

    .card-meta {
        font-size: 0.7rem;
        margin-bottom: 10px;
    }

    .card-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .modal-content {
        max-width: 100%;
        border-radius: var(--radius-sm);
    }
}

@media (max-width: 380px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .card-media:hover .card-video {
        /* hover play handled by JS */
    }
}
