* {
    box-sizing: border-box;
}

:root {
    --bg: #020617;
    --panel: #0f172a;
    --panel-soft: #111827;
    --card: #1e293b;
    --card-strong: #263449;
    --text: #f8fafc;
    --muted: #94a3b8;
    --line: rgba(148, 163, 184, 0.18);
    --emerald: #10b981;
    --emerald-dark: #059669;
    --yellow: #facc15;
    --orange: #f97316;
    --blue: #38bdf8;
    --radius: 20px;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: linear-gradient(180deg, #0f172a 0%, #020617 45%, #020617 100%);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

body.menu-open {
    overflow: hidden;
}

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

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

button,
input,
select {
    font: inherit;
}

.top-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(18px);
}

.nav-inner {
    max-width: 1280px;
    height: 68px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: max-content;
    font-weight: 800;
    letter-spacing: 0.02em;
    font-size: 21px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.16);
    color: var(--emerald);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.34);
}

.nav-search,
.mobile-search {
    position: relative;
    flex: 1;
    max-width: 560px;
}

.nav-search input,
.mobile-search input,
.filter-bar input,
.filter-bar select {
    width: 100%;
    border: 1px solid transparent;
    outline: 0;
    border-radius: 999px;
    background: rgba(51, 65, 85, 0.82);
    color: var(--text);
    padding: 11px 48px 11px 18px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nav-search input:focus,
.mobile-search input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: rgba(16, 185, 129, 0.72);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.13);
    background: rgba(30, 41, 59, 0.96);
}

.nav-search button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.nav-search button:hover {
    color: var(--emerald);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    color: #cbd5e1;
}

.nav-links a,
.nav-dropdown button {
    color: #cbd5e1;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-dropdown button:hover {
    color: #ffffff;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 168px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.98);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu a {
    display: block;
    padding: 9px 12px;
    border-radius: 10px;
}

.nav-dropdown-menu a:hover {
    background: rgba(51, 65, 85, 0.8);
    color: #fff;
}

.mobile-toggle {
    display: none;
    margin-left: auto;
    border: 0;
    border-radius: 12px;
    width: 42px;
    height: 42px;
    color: #fff;
    background: rgba(51, 65, 85, 0.82);
}

.mobile-menu {
    display: none;
    padding: 16px 20px 22px;
    background: #0f172a;
    border-top: 1px solid var(--line);
}

.mobile-menu a {
    display: block;
    padding: 11px 4px;
    color: #cbd5e1;
}

.mobile-search {
    display: flex;
    gap: 8px;
    max-width: none;
    margin-bottom: 10px;
}

.mobile-search input {
    padding-right: 16px;
}

.mobile-search button {
    border: 0;
    border-radius: 999px;
    padding: 0 18px;
    color: #fff;
    background: var(--emerald);
}

.hero {
    position: relative;
    height: 600px;
    overflow: hidden;
    background: #020617;
}

.hero-track {
    height: 100%;
    display: flex;
    transition: transform 0.55s ease;
}

.hero-slide {
    position: relative;
    min-width: 100%;
    height: 100%;
}

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

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.58) 45%, rgba(2, 6, 23, 0.18) 100%);
}

.hero-content {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: 64px;
    width: min(1280px, calc(100% - 40px));
    transform: translateX(-50%);
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 6px 14px;
    border-radius: 999px;
    color: #fff;
    background: var(--emerald);
    font-weight: 700;
    font-size: 14px;
}

.hero h1,
.hero h2 {
    max-width: 830px;
    margin: 0 0 18px;
    font-size: clamp(34px, 5.2vw, 64px);
    line-height: 1.06;
    letter-spacing: -0.04em;
}

.hero p {
    max-width: 760px;
    margin: 0 0 22px;
    color: #cbd5e1;
    font-size: 18px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #cbd5e1;
    margin-bottom: 28px;
}

.hero-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 28px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn {
    color: #fff;
    background: var(--emerald);
    box-shadow: 0 16px 40px rgba(16, 185, 129, 0.24);
}

.primary-btn:hover {
    background: var(--emerald-dark);
    transform: translateY(-2px);
}

.secondary-btn {
    color: #fff;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.24);
}

.secondary-btn:hover {
    background: rgba(148, 163, 184, 0.22);
}

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

.hero-control {
    position: absolute;
    z-index: 3;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
    transition: background 0.2s ease;
}

.hero-control:hover {
    background: rgba(0, 0, 0, 0.78);
}

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

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

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

.hero-dots button {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.46);
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dots button.active {
    width: 34px;
    background: #fff;
}

.main-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 54px 20px;
}

.content-section {
    margin-bottom: 64px;
}

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

.section-heading div:first-child {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    align-items: center;
}

.section-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.12);
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.2;
}

.section-heading p {
    grid-column: 2;
    margin: 4px 0 0;
    color: var(--muted);
}

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(30, 41, 59, 0.82);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.28);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #111827;
}

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

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

.poster-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.68));
}

.rating,
.rank-badge {
    position: absolute;
    z-index: 2;
    border-radius: 999px;
    font-weight: 800;
}

.rating {
    right: 12px;
    bottom: 12px;
    color: #111827;
    background: var(--yellow);
    padding: 4px 9px;
    font-size: 13px;
}

.rank-badge {
    left: 12px;
    top: 12px;
    min-width: 32px;
    text-align: center;
    color: #fff;
    background: rgba(16, 185, 129, 0.94);
    padding: 4px 9px;
}

.card-body {
    padding: 16px;
}

.card-body h3 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 18px;
    line-height: 1.3;
}

.card-body h3 a:hover {
    color: var(--emerald);
}

.card-body p {
    min-height: 48px;
    margin: 0 0 12px;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta-row,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-row {
    margin-bottom: 10px;
    color: #cbd5e1;
    font-size: 13px;
}

.meta-row span,
.tag-row span {
    border-radius: 999px;
    padding: 3px 9px;
}

.meta-row span {
    background: rgba(15, 23, 42, 0.68);
}

.tag-row span {
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.11);
    font-size: 12px;
}

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

.category-tile {
    min-height: 150px;
    padding: 26px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.96), rgba(14, 165, 233, 0.88));
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
    transition: transform 0.2s ease;
}

.category-tile:nth-child(2n) {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.96), rgba(124, 58, 237, 0.9));
}

.category-tile:nth-child(3n) {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.96), rgba(220, 38, 38, 0.9));
}

.category-tile:hover {
    transform: scale(1.035);
}

.category-tile span {
    font-size: 34px;
}

.category-tile h3 {
    margin: 12px 0 8px;
    font-size: 22px;
}

.category-tile p {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
}

.wide-scroll {
    overflow-x: auto;
    padding-bottom: 12px;
}

.wide-row {
    display: flex;
    gap: 18px;
    min-width: max-content;
}

.wide-card {
    width: 360px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(30, 41, 59, 0.9);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.wide-card:hover {
    transform: translateY(-4px);
    border-color: rgba(250, 204, 21, 0.62);
}

.wide-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.wide-card div {
    padding: 16px;
}

.wide-card span {
    display: inline-block;
    margin-bottom: 8px;
    border-radius: 999px;
    padding: 3px 10px;
    color: #111827;
    background: var(--yellow);
    font-size: 12px;
    font-weight: 800;
}

.wide-card h3,
.wide-card p {
    margin: 0;
}

.wide-card h3 {
    margin-bottom: 8px;
}

.wide-card p {
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.page-hero {
    position: relative;
    overflow: hidden;
    padding: 74px 20px;
    background: radial-gradient(circle at 20% 10%, rgba(16, 185, 129, 0.25), transparent 36%), linear-gradient(135deg, #0f172a, #020617);
    border-bottom: 1px solid var(--line);
}

.page-hero-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumb a {
    color: #cbd5e1;
}

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

.page-hero h1 {
    max-width: 900px;
    margin: 0 0 14px;
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.12;
}

.page-hero p {
    max-width: 820px;
    margin: 0;
    color: #cbd5e1;
    font-size: 18px;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px 180px 180px;
    gap: 14px;
    margin: 0 0 28px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.8);
}

.filter-bar input,
.filter-bar select {
    border-radius: 14px;
    padding: 12px 14px;
}

.result-empty {
    display: none;
    padding: 30px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: 20px;
}

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

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

.player-card,
.movie-info-card,
.side-panel {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.86);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.player-card {
    overflow: hidden;
}

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

.player-wrap video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    cursor: pointer;
}

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

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

.play-button {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: rgba(16, 185, 129, 0.94);
    box-shadow: 0 20px 48px rgba(16, 185, 129, 0.28);
    cursor: pointer;
    font-size: 34px;
}

.player-caption {
    padding: 18px 22px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    color: #cbd5e1;
}

.movie-info-card {
    margin-top: 22px;
    padding: 28px;
}

.movie-info-card h2,
.side-panel h2 {
    margin: 0 0 16px;
    font-size: 24px;
}

.movie-info-card p {
    margin: 0 0 18px;
    color: #cbd5e1;
}

.info-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0;
}

.info-list div {
    padding: 13px;
    border-radius: 16px;
    background: rgba(30, 41, 59, 0.82);
}

.info-list span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.info-list strong {
    display: block;
    color: #fff;
    margin-top: 4px;
}

.side-panel {
    padding: 18px;
}

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

.side-item {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 12px;
    align-items: center;
    border-radius: 16px;
    padding: 8px;
    background: rgba(30, 41, 59, 0.68);
    transition: background 0.2s ease;
}

.side-item:hover {
    background: rgba(51, 65, 85, 0.94);
}

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

.side-item h3 {
    margin: 0 0 5px;
    font-size: 15px;
}

.side-item p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 70px 180px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(30, 41, 59, 0.76);
    padding: 14px;
}

.rank-number {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    color: #fff;
    background: var(--emerald);
    font-weight: 900;
}

.rank-row img {
    width: 180px;
    height: 104px;
    object-fit: cover;
    border-radius: 16px;
}

.rank-row h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.rank-row p {
    margin: 0;
    color: var(--muted);
}

.rank-score {
    color: var(--yellow);
    font-size: 22px;
    font-weight: 900;
}

.site-footer {
    background: linear-gradient(180deg, #0f172a, #020617);
    border-top: 1px solid var(--line);
    color: #cbd5e1;
    padding: 46px 20px 22px;
}

.footer-grid {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 32px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 20px;
    margin-bottom: 12px;
}

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

.site-footer p {
    margin: 0;
    color: var(--muted);
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer li {
    margin-bottom: 8px;
}

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

.footer-bottom {
    max-width: 1280px;
    margin: 32px auto 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
}

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

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

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

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

    .mobile-toggle {
        display: grid;
        place-items: center;
    }

    .mobile-menu.open {
        display: block;
    }

    .hero {
        height: 540px;
    }

    .hero-content {
        bottom: 56px;
    }

    .hero-control {
        display: none;
    }

    .filter-bar {
        grid-template-columns: 1fr;
    }

    .rank-row {
        grid-template-columns: 46px 120px 1fr;
    }

    .rank-score {
        grid-column: 3;
        font-size: 18px;
    }

    .rank-row img {
        width: 120px;
        height: 78px;
    }

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

@media (max-width: 640px) {
    .nav-inner {
        height: 62px;
        padding: 0 14px;
    }

    .brand {
        font-size: 18px;
    }

    .hero {
        height: 500px;
    }

    .hero p {
        font-size: 16px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-wrap {
        padding: 36px 14px;
    }

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

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

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

    .wide-card {
        width: 290px;
    }

    .page-hero {
        padding: 48px 14px;
    }

    .info-list {
        grid-template-columns: 1fr;
    }

    .rank-row {
        grid-template-columns: 42px 1fr;
    }

    .rank-row img {
        grid-column: 1 / -1;
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .rank-score {
        grid-column: 2;
    }

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