:root {
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --teal-500: #14b8a6;
    --yellow-400: #facc15;
    --red-500: #ef4444;
    --blue-500: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 6px 16px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 14px 35px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--gray-900);
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 36%, var(--gray-50) 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08), 0 10px 30px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(18px);
}

.site-nav {
    max-width: 1240px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--white);
    background: linear-gradient(135deg, var(--emerald-600), var(--teal-500));
    box-shadow: 0 10px 24px rgba(5, 150, 105, 0.28);
}

.brand-text {
    font-size: 24px;
    background: linear-gradient(90deg, var(--emerald-600), var(--teal-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link,
.dropdown-panel a {
    color: var(--gray-700);
    font-weight: 650;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.dropdown-panel a:hover {
    color: var(--emerald-600);
}

.nav-dropdown {
    position: relative;
}

.dropdown-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.dropdown-panel {
    position: absolute;
    top: calc(100% + 18px);
    right: 0;
    width: 180px;
    padding: 12px;
    display: grid;
    gap: 8px;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    background: var(--white);
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-dropdown:hover .dropdown-panel,
.nav-dropdown:focus-within .dropdown-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.dropdown-panel a {
    padding: 8px 10px;
    border-radius: 10px;
}

.dropdown-panel a:hover {
    background: var(--emerald-50);
}

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: var(--emerald-50);
    cursor: pointer;
}

.mobile-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: var(--emerald-700);
    border-radius: 999px;
}

.container {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 34px 0 56px;
    background:
        radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.18), transparent 34%),
        radial-gradient(circle at 75% 15%, rgba(20, 184, 166, 0.16), transparent 36%),
        linear-gradient(180deg, #ffffff 0%, #f4fef9 100%);
}

.hero-shell {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
}

.hero-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    min-height: 500px;
    box-shadow: var(--shadow-lg);
    background: var(--gray-900);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
}

.hero-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.06);
    transform: scale(1.02);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.72) 45%, rgba(2, 6, 23, 0.18) 100%),
        linear-gradient(0deg, rgba(2, 6, 23, 0.72), transparent 50%);
}

.hero-content {
    position: absolute;
    left: clamp(24px, 5vw, 72px);
    right: clamp(24px, 5vw, 72px);
    bottom: clamp(30px, 6vw, 70px);
    max-width: 760px;
    color: var(--white);
}

.hero-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    margin-bottom: 14px;
    color: var(--white);
    background: rgba(5, 150, 105, 0.92);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
}

.hero h1,
.hero h2 {
    margin: 0 0 14px;
    font-size: clamp(34px, 6vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.hero p {
    max-width: 700px;
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(16px, 2vw, 20px);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.hero-meta span {
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    font-size: 14px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.button-primary,
.button-secondary,
.rank-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 750;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button-primary {
    padding: 13px 22px;
    color: var(--white);
    background: linear-gradient(135deg, var(--emerald-600), var(--teal-500));
    box-shadow: 0 14px 28px rgba(5, 150, 105, 0.28);
}

.button-primary:hover,
.button-secondary:hover,
.rank-action:hover {
    transform: translateY(-2px);
}

.button-secondary {
    padding: 12px 21px;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    color: var(--white);
    background: rgba(15, 23, 42, 0.54);
    cursor: pointer;
    transform: translateY(-50%);
}

.hero-control.prev {
    left: 18px;
}

.hero-control.next {
    right: 18px;
}

.hero-dots {
    position: absolute;
    right: 34px;
    bottom: 28px;
    z-index: 3;
    display: flex;
    gap: 10px;
}

.hero-dots button {
    width: 11px;
    height: 11px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.42);
    cursor: pointer;
}

.hero-dots button.is-active {
    width: 32px;
    background: var(--emerald-500);
}

.hero-search {
    position: relative;
    z-index: 4;
    width: min(1000px, calc(100% - 32px));
    margin: -34px auto 0;
    padding: 18px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    border: 1px solid rgba(209, 213, 219, 0.72);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(18px);
}

.hero-search input,
.search-box input {
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    outline: 0;
    color: var(--gray-900);
    background: var(--white);
}

.hero-search input {
    padding: 14px 18px;
}

.hero-search button {
    min-width: 118px;
    border: 0;
    cursor: pointer;
}

main {
    min-height: 70vh;
}

.section {
    padding: 56px 0;
}

.section-soft {
    background: linear-gradient(90deg, var(--emerald-50), #f0fdfa);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 36px);
    letter-spacing: -0.03em;
}

.section-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: var(--emerald-700);
    background: var(--emerald-100);
    border-radius: 12px;
}

.section-more {
    color: var(--emerald-700);
    font-weight: 750;
}

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

.movie-grid.compact {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 18px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--gray-200);
}

.movie-card-featured .poster-link {
    aspect-ratio: 21 / 9;
}

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

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

.poster-shine {
    position: absolute;
    inset: auto 0 0;
    height: 55%;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.42), transparent);
}

.rank-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: var(--white);
    background: linear-gradient(135deg, #f59e0b, var(--red-500));
    font-weight: 850;
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.24);
}

.card-body {
    padding: 16px;
}

.card-meta,
.card-foot,
.rank-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--gray-500);
    font-size: 13px;
}

.rating {
    color: #d97706;
    font-weight: 800;
}

.movie-card h3,
.rank-item h3 {
    margin: 9px 0 8px;
    color: var(--gray-900);
    font-size: 18px;
    line-height: 1.32;
}

.movie-card h3 a:hover,
.rank-item h3 a:hover {
    color: var(--emerald-600);
}

.movie-card p,
.rank-item p {
    margin: 0 0 12px;
    color: var(--gray-600);
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
}

.tag-row span,
.detail-tags span {
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--emerald-700);
    background: var(--emerald-50);
    font-size: 12px;
    font-weight: 700;
}

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

.category-card {
    position: relative;
    overflow: hidden;
    min-height: 190px;
    padding: 24px;
    border-radius: 22px;
    color: var(--white);
    background: linear-gradient(135deg, var(--gray-900), var(--emerald-700));
    box-shadow: var(--shadow-md);
}

.category-card::after {
    content: "";
    position: absolute;
    right: -35px;
    bottom: -35px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.category-card h2,
.category-card h3 {
    position: relative;
    margin: 0 0 10px;
    font-size: 24px;
}

.category-card p,
.category-card span {
    position: relative;
    color: rgba(255, 255, 255, 0.84);
}

.category-card span {
    display: inline-flex;
    margin-top: 18px;
    font-weight: 800;
}

.filter-panel {
    margin-bottom: 26px;
    padding: 18px;
    border: 1px solid var(--gray-200);
    border-radius: 22px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.search-box {
    display: grid;
    gap: 8px;
    color: var(--gray-600);
    font-weight: 750;
}

.search-box input {
    padding: 13px 16px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

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

.filter-button.is-active,
.filter-button:hover {
    color: var(--white);
    border-color: var(--emerald-600);
    background: var(--emerald-600);
}

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

.rank-item {
    display: grid;
    grid-template-columns: 58px 110px 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-radius: 18px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.rank-num {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: var(--white);
    background: linear-gradient(135deg, var(--emerald-600), var(--teal-500));
    font-weight: 850;
}

.rank-cover {
    overflow: hidden;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    background: var(--gray-200);
}

.rank-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rank-info h3 {
    margin-top: 0;
}

.rank-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.rank-action {
    padding: 10px 16px;
    color: var(--white);
    background: var(--emerald-600);
}

.page-hero {
    padding: 54px 0 38px;
    background: linear-gradient(135deg, var(--gray-900), var(--emerald-700));
    color: var(--white);
}

.page-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(32px, 4vw, 52px);
    letter-spacing: -0.04em;
}

.page-hero p {
    max-width: 820px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 18px;
}

.breadcrumb {
    margin-bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
}

.breadcrumb a:hover {
    color: var(--white);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
    gap: 30px;
    align-items: start;
}

.player-card,
.detail-card {
    overflow: hidden;
    border: 1px solid var(--gray-200);
    border-radius: 22px;
    background: var(--white);
    box-shadow: var(--shadow-md);
}

.player-box {
    position: relative;
    background: #020617;
    aspect-ratio: 16 / 9;
}

.player-box video {
    width: 100%;
    height: 100%;
    display: block;
    background: #020617;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
    background: rgba(2, 6, 23, 0.46);
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.player-overlay img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.42;
}

.play-button {
    position: relative;
    z-index: 1;
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    color: var(--white);
    background: linear-gradient(135deg, var(--emerald-600), var(--teal-500));
    box-shadow: 0 20px 44px rgba(5, 150, 105, 0.34);
    cursor: pointer;
    font-size: 32px;
}

.player-info {
    padding: 24px;
}

.player-info h1,
.detail-card h2 {
    margin: 0 0 12px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 14px 0;
    color: var(--gray-600);
}

.detail-meta span {
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--gray-100);
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 0;
}

.detail-card {
    padding: 24px;
}

.detail-card + .detail-card {
    margin-top: 22px;
}

.detail-card p {
    margin: 0;
    color: var(--gray-700);
}

.side-poster {
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: 18px;
    background: var(--gray-200);
}

.side-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.empty-state {
    display: none;
    padding: 28px;
    border-radius: 18px;
    color: var(--gray-600);
    background: var(--gray-100);
    text-align: center;
}

.empty-state.is-visible {
    display: block;
}

.is-filter-hidden {
    display: none !important;
}

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

    .movie-grid.compact {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .site-nav {
        flex-wrap: wrap;
    }

    .mobile-toggle {
        display: block;
    }

    .nav-links {
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding-top: 14px;
        border-top: 1px solid var(--gray-200);
    }

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

    .nav-dropdown {
        display: none;
    }

    .hero-carousel {
        min-height: 560px;
        border-radius: 22px;
    }

    .hero-overlay {
        background: linear-gradient(0deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.34));
    }

    .hero-search {
        grid-template-columns: 1fr;
    }

    .movie-grid,
    .movie-grid.compact,
    .category-grid,
    .recommend-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rank-item {
        grid-template-columns: 46px 86px 1fr;
    }

    .rank-action {
        grid-column: 2 / 4;
        width: max-content;
    }

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

@media (max-width: 560px) {
    .container,
    .hero-shell {
        width: min(100% - 24px, 1240px);
    }

    .brand-text {
        font-size: 20px;
    }

    .hero {
        padding-top: 18px;
    }

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

    .hero-content {
        left: 18px;
        right: 18px;
        bottom: 54px;
    }

    .hero-control {
        display: none;
    }

    .hero-dots {
        left: 18px;
        right: auto;
        bottom: 22px;
    }

    .section {
        padding: 42px 0;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .movie-grid,
    .movie-grid.compact,
    .category-grid,
    .recommend-grid {
        grid-template-columns: 1fr;
    }

    .rank-item {
        grid-template-columns: 38px 72px 1fr;
        gap: 12px;
        padding: 12px;
    }

    .rank-num {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }
}
