:root {
    --emerald: #059669;
    --emerald-dark: #047857;
    --teal: #0d9488;
    --cyan: #0891b2;
    --rose: #f43f5e;
    --gold: #f59e0b;
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --soft: #f9fafb;
    --card: #ffffff;
    --dark: #111827;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
    --radius: 1.25rem;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--soft);
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

main {
    min-height: 65vh;
}

.container {
    width: min(100% - 2rem, 80rem);
    margin: 0 auto;
}

.narrow-container {
    width: min(100% - 2rem, 56rem);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    color: #ffffff;
    background: linear-gradient(90deg, var(--emerald), var(--teal));
    box-shadow: 0 12px 32px rgba(4, 120, 87, 0.28);
}

.nav-container {
    min-height: 4rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: inherit;
    text-decoration: none;
    font-weight: 800;
    white-space: nowrap;
}

.brand-icon,
.footer-brand span {
    display: inline-flex;
    width: 2.1rem;
    height: 2.1rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.brand-name {
    font-size: 1.25rem;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
}

.nav-link,
.mobile-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 650;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.nav-link:hover,
.mobile-link:hover,
.nav-link.active,
.mobile-link.active {
    color: #d1fae5;
}

.nav-search,
.mobile-search {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search input,
.mobile-search input,
.filter-box input,
.search-page-form input {
    width: 16rem;
    border: 0;
    border-radius: 999px;
    padding: 0.7rem 2.8rem 0.7rem 1rem;
    outline: none;
    color: #111827;
    background: #ffffff;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    transition: box-shadow 0.2s ease;
}

.nav-search input:focus,
.mobile-search input:focus,
.filter-box input:focus,
.search-page-form input:focus {
    box-shadow: 0 0 0 4px rgba(167, 243, 208, 0.65);
}

.nav-search button {
    position: absolute;
    right: 0.35rem;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    color: var(--emerald);
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
}

.menu-toggle {
    display: none;
    margin-left: auto;
    border: 0;
    color: #ffffff;
    background: transparent;
    font-size: 1.8rem;
    cursor: pointer;
}

.mobile-panel {
    display: none;
    width: min(100% - 2rem, 80rem);
    margin: 0 auto;
    padding: 1rem 0 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-panel.is-open {
    display: block;
}

.mobile-search {
    gap: 0.6rem;
}

.mobile-search input {
    width: 100%;
    padding-right: 1rem;
}

.mobile-search button,
.search-page-form button {
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: var(--emerald-dark);
    padding: 0.7rem 1.25rem;
    font-weight: 700;
    cursor: pointer;
}

.mobile-nav {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
}

.hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(135deg, #059669 0%, #0d9488 48%, #0891b2 100%);
    padding: 4.5rem 0 5rem;
}

.hero-bg-glow {
    position: absolute;
    width: 34rem;
    height: 34rem;
    right: -12rem;
    top: -10rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    filter: blur(1px);
}

.hero-shell {
    position: relative;
}

.hero-kicker,
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #d1fae5;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero h1,
.page-hero h1 {
    margin: 0.75rem 0 0.75rem;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: -0.05em;
}

.hero-intro,
.page-hero p {
    max-width: 46rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
}

.hero-carousel {
    position: relative;
    margin-top: 2.4rem;
    min-height: 26rem;
}

.hero-slide {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(17rem, 0.85fr);
    align-items: center;
    gap: 2rem;
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease, visibility 0.5s ease;
}

.hero-slide.is-active {
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hero-copy {
    padding: 2rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15), var(--shadow);
    backdrop-filter: blur(14px);
}

.hero-copy h2 {
    margin: 0.5rem 0 1rem;
    font-size: clamp(2rem, 5vw, 3.8rem);
    font-weight: 900;
    line-height: 1.05;
}

.hero-summary {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    line-height: 1.85;
}

.hero-tags,
.tag-list,
.quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.2rem;
}

.hero-tags span,
.tag-list a,
.quick-tags button {
    border: 0;
    border-radius: 999px;
    color: #065f46;
    background: #d1fae5;
    padding: 0.42rem 0.78rem;
    font-size: 0.88rem;
    font-weight: 750;
    text-decoration: none;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 1.5rem;
}

.primary-button,
.ghost-button,
.section-link,
.category-card span,
.category-tile,
.compact-card,
.rank-card,
.poster-card {
    text-decoration: none;
}

.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0 1.5rem;
    border-radius: 999px;
    font-weight: 850;
}

.primary-button {
    color: var(--emerald);
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}

.ghost-button {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.hero-poster {
    position: relative;
    display: block;
    min-height: 24rem;
    overflow: hidden;
    border-radius: 2rem;
    background: rgba(15, 23, 42, 0.35);
    box-shadow: var(--shadow);
}

.hero-poster img {
    width: 100%;
    height: 100%;
    min-height: 24rem;
    object-fit: cover;
    transform: scale(1.01);
}

.hero-poster span {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(5, 150, 105, 0.88);
    padding: 0.55rem 0.95rem;
    font-weight: 800;
}

.hero-dots {
    display: flex;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 1.5rem;
}

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

.hero-dots button.is-active {
    width: 2rem;
    background: #ffffff;
}

.content-section {
    padding: 4rem 0;
}

.soft-section {
    padding: 4rem 0;
    background: linear-gradient(90deg, #ecfeff, #ecfdf5);
}

.dark-section {
    padding: 4rem 0;
    color: #ffffff;
    background: #111827;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.section-head h2 {
    margin: 0;
    color: inherit;
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    line-height: 1.15;
    font-weight: 900;
}

.section-head p {
    margin: 0.45rem 0 0;
    color: var(--muted);
}

.dark-section .section-head p {
    color: #9ca3af;
}

.section-link {
    color: var(--emerald);
    font-weight: 800;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

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

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

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

.poster-card {
    display: block;
    overflow: hidden;
    border-radius: var(--radius);
    color: inherit;
    background: var(--card);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.poster-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
}

.poster-wrap {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #064e3b;
}

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

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

.poster-badge {
    position: absolute;
    right: 0.65rem;
    top: 0.65rem;
    border-radius: 999px;
    color: #ffffff;
    background: var(--emerald);
    padding: 0.25rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 850;
}

.card-body {
    padding: 1rem;
}

.card-body h3,
.compact-card h3,
.rank-card h3 {
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.35;
    font-weight: 850;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta,
.card-desc,
.compact-card p,
.rank-card p {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.card-desc,
.rank-card p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.rank-card,
.compact-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: inherit;
    overflow: hidden;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
    padding: 0.7rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-card:hover,
.compact-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
}

.rank-card img,
.compact-card img {
    width: 5rem;
    height: 5rem;
    border-radius: 0.8rem;
    object-fit: cover;
    flex: 0 0 auto;
}

.rank-card span,
.compact-card span {
    display: inline-block;
    margin-top: 0.35rem;
    color: var(--emerald);
    font-size: 0.82rem;
    font-weight: 800;
}

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

.rank-item {
    position: relative;
}

.rank-item > strong {
    position: absolute;
    z-index: 2;
    left: -0.35rem;
    top: -0.35rem;
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    box-shadow: 0 8px 22px rgba(249, 115, 22, 0.35);
}

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

.category-tile {
    display: block;
    min-height: 11rem;
    border-radius: var(--radius);
    color: #ffffff;
    background: linear-gradient(135deg, var(--emerald), var(--teal));
    box-shadow: var(--shadow);
    padding: 1.6rem;
    transition: transform 0.25s ease;
}

.category-tile:hover {
    transform: translateY(-5px) scale(1.01);
}

.category-tile span {
    font-size: 1.45rem;
    font-weight: 900;
}

.category-tile p {
    margin: 0.7rem 0 0;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.65;
}

.category-card {
    position: relative;
    display: grid;
    min-height: 18rem;
    overflow: hidden;
    border-radius: var(--radius);
    color: #ffffff;
    box-shadow: var(--shadow);
    text-decoration: none;
}

.category-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.08);
    transform: scale(1.02);
}

.category-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.2), rgba(4, 120, 87, 0.88));
}

.category-card div {
    position: relative;
    z-index: 1;
    align-self: end;
    padding: 1.4rem;
}

.category-card h2 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 900;
}

.category-card p {
    margin: 0.6rem 0 1rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.65;
}

.category-card span {
    color: #065f46;
    background: #d1fae5;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-weight: 850;
}

.page-hero {
    color: #ffffff;
    background: linear-gradient(90deg, var(--emerald), var(--teal));
    padding: 4.6rem 0;
}

.compact-hero {
    padding: 3.4rem 0;
}

.filter-box {
    margin-top: 1.5rem;
}

.filter-box input {
    width: min(100%, 28rem);
    padding-right: 1rem;
}

.empty-filter,
.search-title {
    text-align: center;
    color: var(--muted);
    font-size: 1.1rem;
    padding: 2rem;
}

.ranking-list {
    display: grid;
    gap: 0.8rem;
}

.ranking-row {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr);
    align-items: center;
    gap: 0.8rem;
}

.ranking-row > span {
    display: inline-flex;
    width: 2.4rem;
    height: 2.4rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--gold), #f97316);
    font-weight: 900;
}

.search-hero {
    padding-bottom: 3.4rem;
}

.search-page-form {
    position: relative;
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.search-page-form input {
    width: 100%;
    padding: 1rem 1.2rem;
    font-size: 1rem;
}

.quick-tags button {
    cursor: pointer;
}

.detail-hero {
    padding: 2rem 0 4rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22rem;
    gap: 2rem;
}

.player {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: #000000;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

.player-video,
.player-cover,
.player-cover img {
    width: 100%;
    height: 100%;
}

.player-video {
    display: block;
    object-fit: contain;
    background: #000000;
}

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.player-cover img {
    position: absolute;
    inset: 0;
    object-fit: cover;
    opacity: 0.58;
}

.play-trigger {
    position: relative;
    z-index: 2;
    width: 5.5rem;
    height: 5.5rem;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: var(--emerald);
    font-size: 2.2rem;
    box-shadow: 0 16px 35px rgba(5, 150, 105, 0.45);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.play-trigger:hover {
    transform: scale(1.06);
    background: var(--emerald-dark);
}

.player.is-playing .player-cover {
    display: none;
}

.detail-card,
.side-card {
    margin-top: 1.5rem;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    padding: 1.5rem;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--emerald);
    text-decoration: none;
    font-weight: 750;
}

.breadcrumb em {
    font-style: normal;
}

.detail-card h1 {
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 3rem);
    line-height: 1.15;
    font-weight: 900;
}

.lead-text {
    margin: 1rem 0;
    color: #374151;
    font-size: 1.08rem;
    line-height: 1.8;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 1rem 0;
}

.detail-meta span {
    border-radius: 999px;
    color: #065f46;
    background: #ecfdf5;
    padding: 0.42rem 0.75rem;
    font-weight: 750;
}

.detail-card section {
    border-top: 1px solid var(--line);
    margin-top: 1.4rem;
    padding-top: 1.4rem;
}

.detail-card h2,
.side-card h2 {
    margin: 0 0 0.8rem;
    font-size: 1.35rem;
    font-weight: 900;
}

.detail-card section p {
    color: #374151;
    line-height: 1.9;
    margin: 0;
}

.detail-side {
    min-width: 0;
}

.side-card {
    position: sticky;
    top: 5.5rem;
}

.detail-poster {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 1rem;
    margin-bottom: 1.2rem;
}

.related-list {
    display: grid;
    gap: 0.75rem;
}

.site-footer {
    color: #d1d5db;
    background: #111827;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
    gap: 2rem;
    padding: 3rem 0;
}

.footer-grid h2 {
    margin: 0 0 1rem;
    color: #ffffff;
    font-size: 1rem;
}

.footer-grid p {
    margin: 0.85rem 0 0;
    color: #9ca3af;
    line-height: 1.75;
}

.footer-grid a {
    display: block;
    color: #d1d5db;
    text-decoration: none;
    margin: 0.55rem 0;
}

.footer-grid a:hover {
    color: #6ee7b7;
}

.footer-brand {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid #1f2937;
    color: #9ca3af;
    text-align: center;
    padding: 1.2rem 1rem;
    font-size: 0.9rem;
}

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

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

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

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

    .side-card {
        position: static;
    }
}

@media (max-width: 820px) {
    .desktop-nav,
    .nav-search {
        display: none;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .nav-container {
        min-height: 3.75rem;
    }

    .hero {
        padding: 3rem 0 3.6rem;
    }

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

    .hero-poster,
    .hero-poster img {
        min-height: 19rem;
    }

    .featured-grid,
    .split-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

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

    .search-page-form {
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .container {
        width: min(100% - 1rem, 80rem);
    }

    .hero-copy,
    .detail-card,
    .side-card {
        padding: 1rem;
    }

    .hero-copy h2 {
        font-size: 2rem;
    }

    .movie-grid,
    .small-grid,
    .category-movie-grid,
    .rank-grid,
    .category-grid,
    .category-list-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }

    .rank-card,
    .compact-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .rank-card img,
    .compact-card img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 10;
    }

    .category-card {
        min-height: 14rem;
    }

    .play-trigger {
        width: 4.5rem;
        height: 4.5rem;
    }
}
