:root {
    --emerald-950: #052e2b;
    --emerald-900: #064e3b;
    --emerald-800: #065f46;
    --emerald-700: #047857;
    --emerald-600: #059669;
    --emerald-500: #10b981;
    --teal-700: #0f766e;
    --teal-600: #0d9488;
    --amber-600: #d97706;
    --rose-600: #e11d48;
    --sky-600: #0284c7;
    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --stone-50: #fafaf9;
    --stone-100: #f5f5f4;
    --stone-200: #e7e5e4;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --white: #ffffff;
    --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 14px 30px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 24px 60px rgba(15, 23, 42, 0.22);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--gray-800);
    background: var(--stone-50);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(90deg, var(--emerald-800), var(--teal-700));
    box-shadow: 0 12px 30px rgba(4, 120, 87, 0.25);
}

.header-inner {
    width: min(var(--container), calc(100% - 32px));
    min-height: 64px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: var(--emerald-800);
    background: linear-gradient(135deg, #d1fae5, #ffffff);
    box-shadow: 0 8px 18px rgba(255, 255, 255, 0.18);
    font-size: 14px;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    min-width: 0;
}

.desktop-nav a,
.mobile-nav a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 650;
    transition: color 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active {
    color: #d1fae5;
    transform: translateY(-1px);
}

.header-search,
.mobile-search {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(14px);
}

.header-search input,
.mobile-search input {
    width: 200px;
    border: 0;
    outline: 0;
    padding: 9px 14px;
    color: var(--white);
    background: transparent;
}

.header-search input::placeholder,
.mobile-search input::placeholder {
    color: rgba(209, 250, 229, 0.86);
}

.header-search button,
.mobile-search button {
    border: 0;
    padding: 9px 14px;
    color: var(--emerald-900);
    background: #d1fae5;
    cursor: pointer;
    font-weight: 700;
}

.mobile-toggle {
    display: none;
    margin-left: auto;
    border: 0;
    color: var(--white);
    background: rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 22px;
}

.mobile-nav {
    display: none;
    width: min(var(--container), calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.mobile-nav.is-open {
    display: grid;
    gap: 12px;
}

.mobile-search {
    width: 100%;
    margin-top: 6px;
}

.mobile-search input {
    flex: 1;
    width: auto;
}

.hero-slider {
    position: relative;
    height: 560px;
    overflow: hidden;
    background: #000000;
}

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

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.46) 48%, rgba(0, 0, 0, 0.12)),
        radial-gradient(circle at 18% 76%, rgba(16, 185, 129, 0.36), transparent 34%);
}

.hero-content {
    position: absolute;
    left: 50%;
    bottom: 52px;
    width: min(var(--container), calc(100% - 48px));
    transform: translateX(-50%);
    color: var(--white);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    margin-bottom: 16px;
    border-radius: 999px;
    color: #d1fae5;
    background: rgba(5, 150, 105, 0.68);
    box-shadow: 0 10px 22px rgba(5, 150, 105, 0.24);
    font-weight: 800;
    letter-spacing: 0.08em;
}

.hero-content h1,
.hero-content h2 {
    max-width: 820px;
    margin: 0 0 16px;
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1.08;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.54);
}

.hero-content p {
    max-width: 760px;
    margin: 0 0 20px;
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(17px, 2vw, 21px);
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.48);
}

.hero-tags,
.detail-tags,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags {
    margin-bottom: 26px;
}

.hero-tags span,
.detail-tags span,
.tag-row span {
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--emerald-700);
    background: #d1fae5;
}

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

.primary-btn,
.ghost-btn,
.small-link,
.search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
    padding: 12px 24px;
    color: var(--white);
    background: var(--emerald-600);
    box-shadow: 0 14px 30px rgba(5, 150, 105, 0.34);
}

.primary-btn:hover,
.search-submit:hover {
    transform: translateY(-2px) scale(1.02);
    background: var(--emerald-700);
    box-shadow: var(--shadow-xl);
}

.ghost-btn {
    padding: 11px 22px;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px);
}

.ghost-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.22);
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    color: var(--white);
    background: rgba(0, 0, 0, 0.46);
    cursor: pointer;
    transform: translateY(-50%);
    font-size: 30px;
    line-height: 1;
    transition: background 0.2s ease, transform 0.2s ease;
}

.hero-control:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.06);
}

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

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

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 20px;
    z-index: 6;
    display: flex;
    gap: 8px;
    transform: translateX(-50%);
}

.hero-dot {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
    width: 32px;
    background: var(--white);
}

.section,
.page-shell {
    width: min(var(--container), calc(100% - 32px));
    margin: 0 auto;
}

.section {
    padding: 56px 0;
}

.section.tint {
    width: 100%;
    max-width: none;
    padding: 56px 0;
    background: linear-gradient(135deg, var(--stone-100), #ecfdf5);
}

.section.tint > .section-inner {
    width: min(var(--container), calc(100% - 32px));
    margin: 0 auto;
}

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

.section-heading h1,
.section-heading h2,
.page-title h1 {
    margin: 0;
    color: var(--gray-800);
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.18;
}

.section-heading h1,
.section-heading h2 {
    display: flex;
    align-items: center;
    gap: 12px;
}

.heading-bar {
    width: 8px;
    height: 34px;
    border-radius: 999px;
    background: var(--emerald-600);
}

.heading-bar.teal {
    background: var(--teal-600);
}

.heading-bar.amber {
    background: var(--amber-600);
}

.heading-bar.rose {
    background: var(--rose-600);
}

.heading-bar.sky {
    background: var(--sky-600);
}

.small-link {
    color: var(--emerald-700);
    font-size: 15px;
}

.small-link:hover {
    transform: translateX(3px);
}

.scroll-row {
    display: flex;
    gap: 22px;
    overflow-x: auto;
    padding: 6px 4px 18px;
    scrollbar-width: thin;
}

.scroll-row .movie-card {
    flex: 0 0 315px;
}

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

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

.movie-card,
.category-card,
.list-card,
.stat-card {
    display: block;
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

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

.movie-poster {
    position: relative;
    margin: 0;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--slate-900);
}

.scroll-row .movie-poster,
.list-card img {
    aspect-ratio: 16 / 9;
}

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

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

.year-badge,
.rank-badge,
.list-rank {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--white);
    font-weight: 800;
}

.year-badge {
    top: 10px;
    right: 10px;
    padding: 4px 9px;
    background: var(--emerald-600);
    font-size: 12px;
}

.rank-badge {
    left: 10px;
    top: 10px;
    min-width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--amber-600), var(--rose-600));
}

.movie-card-body {
    padding: 16px;
}

.movie-card-body.compact {
    padding: 12px;
}

.movie-card h3,
.list-card h3,
.category-card h2,
.stat-card h2 {
    margin: 0 0 8px;
    color: var(--gray-800);
    line-height: 1.28;
}

.movie-card h3 {
    display: -webkit-box;
    min-height: 42px;
    overflow: hidden;
    font-size: 17px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-card-body.compact h3 {
    min-height: 38px;
    font-size: 15px;
}

.movie-card p,
.list-card p,
.category-card p,
.page-title p,
.detail-summary p {
    color: var(--gray-600);
}

.movie-card p {
    display: -webkit-box;
    min-height: 44px;
    margin: 0 0 12px;
    overflow: hidden;
    font-size: 14px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--gray-500);
    font-size: 13px;
}

.tag-row {
    margin-top: 10px;
}

.tag-row span {
    padding: 4px 8px;
    font-size: 12px;
    background: var(--gray-100);
    color: var(--emerald-700);
}

.list-stack {
    display: grid;
    gap: 16px;
}

.list-card {
    position: relative;
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 18px;
    padding: 14px;
}

.list-card img {
    width: 100%;
    height: 100%;
    min-height: 118px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--slate-900);
}

.list-rank {
    left: 24px;
    top: 24px;
    z-index: 2;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--amber-600), var(--rose-600));
}

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

.category-card,
.stat-card {
    padding: 22px;
    min-height: 168px;
}

.category-card h2,
.stat-card h2 {
    font-size: 22px;
}

.category-card p,
.stat-card p {
    margin: 0 0 18px;
    color: var(--gray-600);
    font-size: 14px;
}

.category-card span,
.stat-card span {
    color: var(--emerald-700);
    font-weight: 800;
}

.page-hero {
    padding: 58px 0;
    color: var(--white);
    background:
        radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.38), transparent 34%),
        linear-gradient(135deg, var(--slate-900), var(--emerald-900));
}

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

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

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

.breadcrumb a:hover {
    color: #d1fae5;
}

.search-panel {
    margin-bottom: 30px;
    padding: 22px;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.search-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px 180px auto;
    gap: 12px;
}

.search-grid input,
.search-grid select {
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    outline: 0;
    padding: 12px 16px;
    background: var(--gray-50);
}

.search-grid input:focus,
.search-grid select:focus {
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}

.search-submit {
    border: 0;
    padding: 12px 22px;
    color: var(--white);
    background: var(--emerald-600);
    cursor: pointer;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    align-items: start;
}

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

.player-shell video {
    width: 100%;
    height: 100%;
    background: #000000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    cursor: pointer;
    background:
        linear-gradient(0deg, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.12)),
        radial-gradient(circle, rgba(16, 185, 129, 0.18), transparent 45%);
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.play-button {
    width: 88px;
    height: 88px;
    border: 0;
    border-radius: 999px;
    color: var(--emerald-800);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    font-size: 34px;
    transition: transform 0.22s ease, background 0.22s ease;
}

.play-button:hover {
    transform: scale(1.08);
    background: #d1fae5;
}

.detail-panel,
.detail-summary,
.related-panel {
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.detail-panel {
    overflow: hidden;
}

.detail-panel img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: var(--slate-900);
}

.detail-panel-body,
.detail-summary,
.related-panel {
    padding: 22px;
}

.detail-panel h2,
.detail-summary h2,
.related-panel h2 {
    margin: 0 0 14px;
    color: var(--gray-800);
}

.detail-summary {
    margin-top: 24px;
}

.detail-summary p {
    margin: 0 0 16px;
    font-size: 16px;
}

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

.related-panel {
    margin-top: 24px;
}

.back-top {
    display: inline-flex;
    margin-top: 30px;
    color: var(--emerald-700);
    font-weight: 800;
}

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

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

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

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

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

    .detail-panel {
        display: grid;
        grid-template-columns: 220px 1fr;
    }

    .detail-panel img {
        height: 100%;
    }
}

@media (max-width: 760px) {
    .hero-slider {
        height: 520px;
    }

    .hero-content {
        bottom: 50px;
    }

    .hero-control {
        display: none;
    }

    .card-grid,
    .poster-grid,
    .category-grid,
    .stats-grid,
    .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .scroll-row .movie-card {
        flex-basis: 265px;
    }

    .list-card {
        grid-template-columns: 120px 1fr;
        gap: 12px;
    }

    .list-card img {
        min-height: 92px;
    }

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

    .detail-panel {
        display: block;
    }

    .section,
    .section.tint {
        padding: 38px 0;
    }

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

@media (max-width: 520px) {
    .header-inner,
    .mobile-nav,
    .section,
    .page-shell,
    .page-title,
    .section.tint > .section-inner {
        width: min(100% - 22px, var(--container));
    }

    .brand {
        font-size: 17px;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
    }

    .hero-content h1,
    .hero-content h2 {
        font-size: 31px;
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
        max-width: 260px;
    }

    .card-grid,
    .poster-grid,
    .category-grid,
    .stats-grid,
    .related-grid {
        grid-template-columns: 1fr;
    }

    .movie-card h3 {
        min-height: auto;
    }
}
