:root {
    --cyan: #06b6d4;
    --cyan-dark: #0891b2;
    --blue: #2563eb;
    --teal: #14b8a6;
    --green: #22c55e;
    --red: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 35px rgba(15, 23, 42, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--gray-900);
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
video {
    display: block;
    max-width: 100%;
}

button,
input {
    font: inherit;
}

.container-custom {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: var(--shadow-md);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
}

.logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--cyan), var(--blue), var(--teal));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    font-size: 15px;
    box-shadow: 0 10px 22px rgba(6, 182, 212, 0.22);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    font-weight: 600;
    color: var(--gray-700);
}

.nav-links a {
    position: relative;
    padding: 24px 0;
    transition: color 0.2s ease;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 18px;
    width: 100%;
    height: 2px;
    background: var(--cyan-dark);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: var(--gray-100);
    color: var(--gray-700);
}

.hero-section {
    position: relative;
    overflow: hidden;
    padding: 74px 0 70px;
    background: linear-gradient(135deg, #ecfeff 0%, #eff6ff 50%, #f0fdfa 100%);
}

.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(to right, rgba(15, 23, 42, 0.04) 1px, transparent 1px), linear-gradient(to bottom, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.55;
}

.hero-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
    align-items: center;
    gap: 42px;
}

.hero-kicker,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 7px 14px;
    border-radius: 999px;
    color: var(--cyan-dark);
    background: rgba(207, 250, 254, 0.8);
    font-size: 14px;
    font-weight: 700;
}

.hero-title {
    margin: 0;
    max-width: 760px;
    font-size: clamp(42px, 6vw, 76px);
    line-height: 1.04;
    letter-spacing: -0.05em;
    font-weight: 900;
}

.gradient-text {
    background: linear-gradient(90deg, var(--cyan), var(--blue), var(--teal));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-lead {
    max-width: 680px;
    margin: 22px 0 28px;
    color: var(--gray-600);
    font-size: clamp(17px, 2vw, 22px);
}

.hero-actions,
.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 14px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.2);
}

.btn-secondary,
.btn-ghost {
    color: var(--gray-700);
    background: #fff;
    border: 1px solid var(--gray-200);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-ghost:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary:hover,
.btn-ghost:hover {
    color: var(--cyan-dark);
    border-color: rgba(6, 182, 212, 0.45);
}

.hero-search {
    display: flex;
    width: min(100%, 560px);
    margin-top: 30px;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: var(--shadow-md);
}

.hero-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 16px 18px;
    color: var(--gray-700);
}

.hero-search button {
    border: 0;
    padding: 0 22px;
    color: #fff;
    background: var(--cyan-dark);
    cursor: pointer;
    font-weight: 700;
}

.hero-carousel {
    position: relative;
    min-height: 560px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-rows: 1fr auto;
    overflow: hidden;
    border-radius: 30px;
    background: #0f172a;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}

.hero-slide.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 560px;
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.15), rgba(15, 23, 42, 0.86));
}

.hero-slide-content {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 28px;
    z-index: 2;
    color: #fff;
}

.hero-slide-content h2 {
    margin: 0 0 10px;
    font-size: clamp(26px, 4vw, 42px);
    line-height: 1.15;
}

.hero-slide-content p {
    margin: 0 0 18px;
    color: rgba(255, 255, 255, 0.86);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.hero-badges,
.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.hero-badges span,
.detail-badges span,
.tag-list span {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: var(--cyan-dark);
    background: rgba(207, 250, 254, 0.92);
}

.hero-dots {
    position: absolute;
    z-index: 5;
    right: 24px;
    top: 24px;
    display: flex;
    gap: 8px;
}

.hero-dots button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.46);
    cursor: pointer;
}

.hero-dots button.active {
    width: 26px;
    border-radius: 999px;
    background: #fff;
}

.section {
    padding: 72px 0;
}

.section.gray {
    background: var(--gray-50);
}

.section-heading {
    margin-bottom: 34px;
    text-align: center;
}

.section-heading h2,
.page-title h1,
.detail-copy h1 {
    margin: 0 0 12px;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.18;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.section-heading p,
.page-title p {
    margin: 0 auto;
    max-width: 740px;
    color: var(--gray-600);
    font-size: 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    padding: 26px;
    border-radius: 22px;
    text-align: center;
    background: linear-gradient(135deg, var(--gray-50), #fff);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover,
.movie-card:hover,
.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card strong {
    display: block;
    font-size: 28px;
    color: var(--gray-900);
}

.stat-card span {
    color: var(--gray-600);
    font-weight: 600;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.movie-card {
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    border: 1px solid rgba(229, 231, 235, 0.86);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.movie-poster {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(135deg, #e0f2fe, #eff6ff);
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.movie-card:hover .movie-poster img {
    transform: scale(1.07);
}

.movie-poster::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 58%;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.68));
}

.movie-year {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    padding: 4px 9px;
    border-radius: 10px;
    color: #fff;
    background: var(--red);
    font-size: 12px;
    font-weight: 800;
}

.movie-play {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    color: #fff;
    background: rgba(6, 182, 212, 0.88);
    transform: translate(-50%, -50%) scale(0.88);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .movie-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.movie-info {
    padding: 18px;
}

.movie-title {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
    line-height: 1.28;
    font-weight: 800;
    color: var(--gray-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-title:hover {
    color: var(--cyan-dark);
}

.movie-meta {
    margin: 0 0 10px;
    color: var(--gray-500);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-desc {
    min-height: 44px;
    margin: 0 0 14px;
    color: var(--gray-600);
    font-size: 14px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}

.category-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 160px;
    padding: 24px;
    border-radius: 24px;
    background: linear-gradient(135deg, #fff, #f0fdfa);
    border: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card strong {
    font-size: 20px;
}

.category-card span {
    color: var(--gray-600);
}

.rank-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.rank-list {
    display: grid;
    gap: 12px;
}

.rank-item {
    display: grid;
    grid-template-columns: 46px 72px 1fr;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-item:hover {
    transform: translateX(4px);
    border-color: rgba(6, 182, 212, 0.45);
}

.rank-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    font-weight: 900;
}

.rank-item img {
    width: 72px;
    height: 96px;
    object-fit: cover;
    border-radius: 12px;
}

.rank-text {
    min-width: 0;
}

.rank-text strong,
.rank-text small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-text small {
    color: var(--gray-500);
}

.page-hero {
    padding: 58px 0;
    background: linear-gradient(135deg, #ecfeff, #eff6ff 55%, #f0fdfa);
}

.page-title {
    text-align: center;
}

.filter-panel {
    position: sticky;
    top: 72px;
    z-index: 35;
    padding: 16px 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.filter-inner {
    display: grid;
    grid-template-columns: minmax(240px, 420px) 1fr;
    align-items: center;
    gap: 18px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    background: #fff;
}

.search-box span {
    color: var(--cyan-dark);
    font-weight: 800;
}

.search-box input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--gray-700);
}

.quick-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.quick-filters button {
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    padding: 8px 13px;
    background: #fff;
    color: var(--gray-700);
    cursor: pointer;
    font-weight: 700;
}

.quick-filters button:hover,
.quick-filters button.active {
    color: #fff;
    background: var(--cyan-dark);
    border-color: var(--cyan-dark);
}

.detail-hero {
    padding: 46px 0 34px;
    background: linear-gradient(135deg, #ecfeff, #eff6ff 55%, #f0fdfa);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    color: var(--gray-600);
    font-size: 14px;
}

.breadcrumbs a {
    color: var(--cyan-dark);
    font-weight: 700;
}

.detail-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 34px;
    align-items: start;
}

.detail-cover {
    overflow: hidden;
    border-radius: 28px;
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.detail-cover img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.detail-copy h1 {
    font-size: clamp(32px, 5vw, 56px);
}

.detail-copy p {
    color: var(--gray-600);
    font-size: 18px;
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.detail-meta div {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(229, 231, 235, 0.8);
}

.detail-meta span {
    display: block;
    color: var(--gray-500);
    font-size: 13px;
}

.detail-meta strong {
    display: block;
    color: var(--gray-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-section {
    padding: 52px 0 0;
    background: #fff;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: #020617;
    box-shadow: var(--shadow-lg);
}

.player-shell video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.62));
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.play-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 82px;
    height: 82px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    cursor: pointer;
    box-shadow: 0 18px 38px rgba(37, 99, 235, 0.28);
    font-size: 28px;
}

.content-panel {
    display: grid;
    gap: 22px;
}

.text-block {
    padding: 28px;
    border-radius: 24px;
    background: #fff;
    border: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: var(--shadow-md);
}

.text-block h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.text-block p {
    margin: 0;
    color: var(--gray-600);
    font-size: 17px;
}

.site-footer {
    margin-top: 72px;
    padding: 46px 0 24px;
    background: linear-gradient(180deg, var(--gray-50), var(--gray-100));
    border-top: 1px solid var(--gray-200);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.4fr;
    gap: 34px;
}

.site-footer p {
    max-width: 460px;
    color: var(--gray-600);
}

.site-footer h3 {
    margin: 0 0 12px;
}

.site-footer a:not(.footer-logo) {
    display: block;
    margin: 7px 0;
    color: var(--gray-600);
}

.site-footer a:hover {
    color: var(--cyan-dark);
}

.copyright {
    width: min(1280px, calc(100% - 32px));
    margin: 28px auto 0;
    padding-top: 22px;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-500);
    font-size: 14px;
}

.back-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 45;
    display: none;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--cyan-dark);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
}

.back-top.show {
    display: inline-flex;
}

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

    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hero-layout,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .hero-carousel {
        min-height: 520px;
    }
}

@media (max-width: 760px) {
    .container-custom {
        width: min(100% - 24px, 1280px);
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links {
        position: absolute;
        left: 12px;
        right: 12px;
        top: 72px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px;
        border-radius: 18px;
        background: #fff;
        box-shadow: var(--shadow-lg);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 13px 14px;
        border-radius: 12px;
    }

    .nav-links a::after {
        display: none;
    }

    .hero-section {
        padding: 46px 0;
    }

    .hero-carousel,
    .hero-slide img {
        min-height: 420px;
    }

    .stats-grid,
    .movie-grid,
    .rank-layout,
    .footer-grid,
    .filter-inner,
    .detail-meta {
        grid-template-columns: 1fr;
    }

    .category-grid {
        grid-template-columns: 1fr 1fr;
    }

    .quick-filters {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }

    .quick-filters button {
        white-space: nowrap;
    }

    .filter-panel {
        position: static;
    }
}

@media (max-width: 520px) {
    .movie-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .hero-search {
        flex-direction: column;
    }

    .hero-search button {
        min-height: 46px;
    }

    .rank-item {
        grid-template-columns: 38px 58px 1fr;
    }

    .rank-item img {
        width: 58px;
        height: 78px;
    }
}
