/* ==========================================================================
   Base Styles & Variables
   ========================================================================== */
:root {
    --bg-color: #0d0f12;
    --surface-color: #1a1d24;
    --surface-hover: #262a33;
    --glass-bg: rgba(20, 26, 36, 0.24);
    --glass-bg-strong: rgba(20, 26, 36, 0.28);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-highlight: rgba(255, 255, 255, 0.25);
    --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.38);
    --glow-color: rgba(255, 97, 143, 0.35);
    --primary-color: #ff3366;
    --primary-hover: #e62e5c;
    --text-primary: #ffffff;
    --text-secondary: #8c92a4;
    --border-color: #2d313d;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --transition-speed: 0.3s;
    --ease-out-smooth: cubic-bezier(0.25, 0.8, 0.25, 1);
    --border-radius: 24px;
    --container-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 10% -10%, rgba(255, 51, 102, 0.15), transparent 38%),
                      radial-gradient(circle at 90% 110%, rgba(0, 164, 255, 0.16), transparent 35%);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.ambient-lights {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.ambient-light {
    position: absolute;
    border-radius: 999px;
    filter: blur(24px);
    opacity: 0.8;
}

.ambient-light--one {
    width: 420px;
    height: 420px;
    top: 12%;
    left: -20px;
    background: radial-gradient(circle, rgba(255, 71, 128, 0.58) 0%, rgba(255, 71, 128, 0.2) 42%, rgba(255, 71, 128, 0) 78%);
}

.ambient-light--two {
    width: 400px;
    height: 400px;
    right: -220px;
    bottom: -120px;
    background: radial-gradient(circle, rgba(0, 164, 255, 0.45) 0%, rgba(0, 164, 255, 0) 72%);
}

.glass,
.glass-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), var(--glass-bg));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
}

.glow,
.light-reactive {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    --mx: 50%;
    --my: 50%;
}

.glow::before,
.light-reactive::before {
    content: "";
    position: absolute;
    inset: -1px;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: all 0.4s var(--ease-out-smooth);
    background: radial-gradient(220px circle at var(--mx) var(--my), var(--glow-color) 0%, rgba(255, 255, 255, 0.05) 35%, transparent 72%);
}

.glow:hover::before,
.glow.is-active::before,
.light-reactive:hover::before,
.light-reactive.is-active::before {
    opacity: 1;
}

.glow > *,
.light-reactive > * {
    position: relative;
    z-index: 1;
}

.gradient-glow {
    background-image: linear-gradient(135deg, rgba(0, 198, 255, 0.2), rgba(0, 114, 255, 0.22));
    box-shadow: 0 0 20px rgba(0, 114, 255, 0.4), 0 0 42px rgba(0, 198, 255, 0.2);
    transition: all 0.4s var(--ease-out-smooth);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass,
    .glass-panel {
        background: rgba(20, 26, 36, 0.28);
    }
}

[data-io-reveal] {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    transition: opacity 420ms ease, transform 420ms ease;
    transition-delay: calc(var(--io-order, 0) * 70ms);
}

[data-io-reveal].is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
    position: fixed;
    top: 12px;
    width: 100%;
    height: 82px;
    background: transparent;
    z-index: 1000;
    border: none;
}

.header.glass {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 58px;
    border-radius: 999px;
    background: rgba(20, 26, 36, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
    padding: 0 24px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 28px;
    width: auto;
    display: block;
}

.logo h1 {
    font-size: 24px;
    color: var(--primary-color);
    font-weight: 700;
}

.nav ul {
    display: flex;
    gap: 8px;
}

.nav a {
    font-size: 15px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.86);
    transition: all 0.3s ease;
}

.nav a:hover, .nav a.active {
    color: #fff;
    background: transparent;
}

/* ==========================================================================
   Banner
   ========================================================================== */
.banner {
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.8)), url('https://images.unsplash.com/photo-1536440136628-849c177e76a1?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 70px;
}

.banner-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.banner-video.is-paused {
    display: none;
}

.banner::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(circle at 20% 35%, rgba(0, 198, 255, 0.22), transparent 42%),
        radial-gradient(circle at 80% 70%, rgba(255, 87, 151, 0.2), transparent 45%);
}

.banner::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(7, 10, 18, 0.5), rgba(7, 10, 18, 0.76));
}

.banner-content h2 {
    font-size: 48px;
    margin-bottom: 0px;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
}

.banner-title-logo {
    height: 160px;
    width: auto;
    max-width: min(720px, 92vw);
    display: inline-block;
    filter: drop-shadow(0 6px 22px rgba(0, 0, 0, 0.55));
}

.banner-content {
    position: relative;
    z-index: 2;
    overflow: visible;
    background: transparent;
    background-image: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.banner-content.glow::before {
    display: none;
}

.banner-content.gradient-glow {
    background-image: none;
    box-shadow: none;
}

.banner-content p {
    font-size: 20px;
    color: rgba(230, 236, 248, 0.96);
    margin-bottom: 40px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.68);
}

.btn-primary {
    display: inline-block;
    position: relative;
    isolation: isolate;
    background: linear-gradient(rgba(13, 15, 18, 0.15), rgba(13, 15, 18, 0.02)) padding-box;
    color: rgba(255, 255, 255, 0.92);
    padding: 13px 38px;
    border-radius: 999px;
    font-size: 18px;
    font-weight: 650;
    letter-spacing: 0.5px;
    transition: transform 0.4s var(--ease-out-smooth), box-shadow 0.4s var(--ease-out-smooth), color 0.4s var(--ease-out-smooth);
    border: 1px solid rgba(255, 255, 255, 0.22);
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    color: #fff;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 198, 255, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

.btn-secondary {
    display: inline-block;
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.4s var(--ease-out-smooth);
}

.btn-secondary:hover {
    background-color: var(--surface-hover);
    border-color: var(--text-secondary);
    box-shadow: 0 0 20px rgba(0, 114, 255, 0.28);
}

/* ==========================================================================
   Filter Section
   ========================================================================== */
.main-content {
    padding: 60px 20px;
}

.filter-section {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
    border-radius: var(--border-radius);
    margin-bottom: 40px;
}

.filter-section.glow::before {
    display: none;
}

.filter-group {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    width: 100px;
    color: var(--text-secondary);
    font-size: 15px;
    flex-shrink: 0;
}

.filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-list li {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.filter-list li:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
}

.filter-list li.active {
    background: rgba(255, 51, 102, 0.2);
    border-color: rgba(255, 51, 102, 0.45);
    color: #fff;
}

.sort-group {
    margin-bottom: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.sort-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-tab {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-tab:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
}

.sort-tab.active {
    color: #fff;
    background: rgba(255, 51, 102, 0.2);
    border-color: rgba(255, 51, 102, 0.45);
}

/* ==========================================================================
   Video Grid
   ========================================================================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 22px 16px;
}

.video-section-title {
    position: relative;
    z-index: 1;
    display: inline-block;
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 2px;
    margin: 4px 0 40px;
    line-height: 1.05;
    padding: 0;
    color: #fff;
    text-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.video-section-title.glass {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.video-section-title::before {
    content: "";
    position: absolute;
    width: 78px;
    height: 78px;
    left: 0;
    top: -18px;
    border-radius: 50%;
    z-index: -1;
    filter: blur(10px);
    background: radial-gradient(circle, rgba(255, 177, 150, 0.55) 0%, rgba(255, 177, 150, 0.12) 55%, rgba(255, 177, 150, 0) 72%);
}

.video-card {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
    transition: all 0.4s var(--ease-out-smooth);
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-4px);
}

.video-card.glow::before {
    display: none;
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 145%;
    background-color: #222;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.video-thumbnail img.loaded {
    opacity: 1;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.video-episodes {
    position: absolute;
    right: 8px;
    bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.72);
}

.quality-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(45deg, #ff9900, #ff3366);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.playable-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.video-info {
    padding: 10px 2px 0;
}

.video-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.25;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.video-tag {
    font-size: 11px;
    color: #95a0b5;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 2px 8px;
}

/* ==========================================================================
   Load More & Loader
   ========================================================================== */
.load-more {
    text-align: center;
    margin-top: 40px;
}

.loader {
    border: 3px solid var(--surface-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.hidden {
    display: none !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    margin-top: 40px;
}

/* ==========================================================================
   Floating Actions
   ========================================================================== */
.floating-actions {
    position: fixed;
    right: 30px;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 999;
}

.action-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(22, 26, 35, 0.66));
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s var(--ease-out-smooth);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.action-btn:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 114, 255, 0.4), 0 0 32px rgba(255, 87, 151, 0.2);
}

.wechat-btn {
    color: #07c160;
}

.wechat-btn:hover {
    color: #fff;
    background-color: #07c160;
    border-color: #07c160;
}

.phone-btn {
    color: #00a4ff;
}

.phone-btn:hover {
    color: #fff;
    background-color: #00a4ff;
    border-color: #00a4ff;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.1), rgba(22, 26, 35, 0.74));
    padding: 40px;
    border-radius: var(--border-radius);
    text-align: center;
    position: relative;
    max-width: 400px;
    width: 90%;
    animation: modalFadeIn 0.3s ease;
}

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

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition-speed);
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

.qrcode-placeholder {
    width: 200px;
    height: 200px;
    background-color: #fff;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #333;
    border-radius: 8px;
}

.qrcode-placeholder p {
    margin-top: 10px;
    font-size: 14px;
}

.phone-number {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary-color);
    margin: 20px 0 10px;
}

.service-time {
    color: var(--text-secondary);
    font-size: 14px;
}

.video-player-modal {
    z-index: 2100;
}

.video-player-content {
    width: min(90vw, 980px);
    max-width: 980px;
    padding: 24px;
    text-align: left;
}

.video-player-content.is-vertical {
    width: min(90vw, 520px);
    max-width: 520px;
}

.video-player-content h3 {
    margin-bottom: 14px;
}

#floating-video-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #000;
    outline: none;
    max-height: 70vh;
    object-fit: contain;
}

#floating-video-player.is-vertical {
    aspect-ratio: 9 / 16;
}

.player-close-btn {
    position: absolute;
    top: 10px;
    right: 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.player-close-btn:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1600px) {
    .video-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1280px) {
    .video-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .video-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .banner-content h2 {
        font-size: 32px;
    }

    .banner-title-logo {
        height: 120px;
    }
    
    .banner-content p {
        font-size: 16px;
    }
    
    .nav {
        display: none; /* 移动端可以实现汉堡菜单，这里为了简洁先隐藏 */
    }

    .filter-label {
        width: 100%;
        margin-bottom: 8px;
    }

    .sort-group {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 12px;
    }

    .video-thumbnail {
        padding-top: 145%;
    }

    .video-title {
        font-size: 15px;
    }

    .video-section-title {
        font-size: 32px;
    }
    
    /* 竖屏视频在移动端可以并排显示或者特殊布局，目前统一处理为列表 */
    
    .floating-actions {
        right: 15px;
        bottom: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    [data-io-reveal] {
        opacity: 1;
        transform: none;
    }

    .glow::before,
    .light-reactive::before {
        display: none;
    }

    .banner-video {
        display: none;
    }
}
