* {
    box-sizing: border-box;
}

:root {
    --bg: #020617;
    --panel: #0f172a;
    --panel-soft: #111827;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: rgba(148, 163, 184, 0.22);
    --green: #10b981;
    --green-dark: #059669;
    --cyan: #22d3ee;
    --amber: #f59e0b;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
    --radius: 22px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: #f8fafc;
    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;
    width: 100%;
}

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.96));
    color: #fff;
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.25);
}

.header-inner {
    max-width: 1240px;
    height: 68px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 26px;
}

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

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ecfeff;
    background: linear-gradient(135deg, var(--green), var(--cyan));
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.35);
}

.brand-text {
    font-size: 22px;
    background: linear-gradient(90deg, #34d399, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.nav-link {
    padding: 9px 14px;
    border-radius: 999px;
    color: #cbd5e1;
    font-size: 15px;
    transition: background 0.25s ease, color 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(16, 185, 129, 0.18);
}

.nav-search,
.wide-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-search input,
.wide-search input,
.toolbar input,
.toolbar select {
    border: 1px solid rgba(148, 163, 184, 0.28);
    outline: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 10px 14px;
    min-width: 220px;
}

.nav-search input::placeholder,
.wide-search input::placeholder {
    color: rgba(226, 232, 240, 0.68);
}

.nav-search button,
.wide-search button {
    border: 0;
    border-radius: 999px;
    color: #052e2b;
    background: linear-gradient(135deg, #34d399, #22d3ee);
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 700;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    background: #fff;
    border-radius: 2px;
}

.hero {
    position: relative;
    height: 72vh;
    min-height: 520px;
    overflow: hidden;
    background: #020617;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.9s ease, transform 1.2s ease;
    transform: scale(1.02);
}

.hero-slide.active {
    opacity: 1;
    transform: scale(1);
}

.hero-slide img,
.detail-bg {
    height: 100%;
    object-fit: cover;
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.55) 46%, rgba(2, 6, 23, 0.2)), linear-gradient(0deg, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.2) 56%, rgba(2, 6, 23, 0.5));
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100vw - 1240px) / 2 + 24px));
    bottom: 90px;
    width: min(690px, calc(100vw - 48px));
    color: #fff;
}

.hero-tags,
.tag-row,
.detail-meta,
.rank-meta,
.page-hero-actions,
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.hero-tags span,
.tag-row span,
.detail-meta span,
.rank-meta span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 13px;
    color: #d1fae5;
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.hero h1 {
    margin: 18px 0 16px;
    font-size: clamp(42px, 7vw, 76px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero p {
    margin: 0 0 30px;
    max-width: 680px;
    color: #dbeafe;
    font-size: 18px;
}

.primary-button,
.ghost-button,
.rank-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 12px 20px;
    min-height: 46px;
    font-weight: 800;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.primary-button,
.rank-action {
    color: #052e2b;
    background: linear-gradient(135deg, #34d399, #22d3ee);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.25);
}

.ghost-button {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: rgba(15, 23, 42, 0.58);
    font-size: 34px;
    cursor: pointer;
}

.hero-prev {
    left: 28px;
}

.hero-next {
    right: 28px;
}

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    display: flex;
    gap: 9px;
}

.hero-dot {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
}

.hero-dot.active {
    width: 30px;
    background: #34d399;
}

.search-hero-panel,
.content-section,
.page-hero,
.detail-wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.search-hero-panel {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    gap: 30px;
    margin-top: -54px;
    position: relative;
    z-index: 4;
    border-radius: var(--radius);
    padding-top: 28px;
    padding-bottom: 28px;
    color: #fff;
    background: linear-gradient(135deg, #0f172a, #064e3b 52%, #155e75);
    box-shadow: var(--shadow);
}

.search-hero-panel h2,
.search-hero-panel p {
    margin: 0;
}

.search-hero-panel p {
    color: #dbeafe;
    margin-top: 6px;
}

.wide-search {
    justify-content: flex-end;
}

.wide-search input {
    min-width: min(430px, 100%);
    background: rgba(255, 255, 255, 0.16);
}

.content-section {
    padding-top: 64px;
    padding-bottom: 24px;
}

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

.section-head h2,
.page-hero h1,
.detail-info h1,
.detail-text h2 {
    margin: 0;
    color: #0f172a;
}

.section-head h2 {
    font-size: clamp(26px, 4vw, 38px);
}

.section-head a {
    color: var(--green-dark);
    font-weight: 800;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

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

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

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

.movie-card {
    overflow: hidden;
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

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

.card-poster {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #0f172a;
}

.movie-card.feature .card-poster {
    aspect-ratio: 16 / 10;
}

.card-poster img {
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.movie-card:hover .card-poster img,
.category-tile:hover img,
.category-panel:hover img,
.compact-card:hover img {
    transform: scale(1.06);
}

.card-poster::after,
.category-tile::after,
.category-panel::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 48%;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.82), transparent);
}

.card-badge,
.card-rating {
    position: absolute;
    z-index: 2;
    top: 12px;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 800;
}

.card-badge {
    left: 12px;
    color: #ecfeff;
    background: rgba(16, 185, 129, 0.9);
}

.card-rating {
    right: 12px;
    color: #111827;
    background: rgba(250, 204, 21, 0.96);
}

.card-body {
    padding: 15px;
}

.card-body h3 {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.35;
}

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

.card-meta,
.card-desc {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.card-desc {
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.tag-row span {
    color: #047857;
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.dark-section {
    max-width: none;
    margin-top: 34px;
    padding: 58px max(24px, calc((100vw - 1240px) / 2 + 24px));
    color: #fff;
    background: radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.24), transparent 34%), linear-gradient(135deg, #020617, #0f172a 55%, #064e3b);
}

.dark-section .section-head h2,
.dark-section .section-head a {
    color: #fff;
}

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

.category-tile,
.category-panel {
    position: relative;
    overflow: hidden;
    min-height: 180px;
    border-radius: 22px;
    background: #0f172a;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.18);
}

.category-tile img,
.category-panel img {
    position: absolute;
    inset: 0;
    height: 100%;
    object-fit: cover;
    opacity: 0.72;
    transition: transform 0.45s ease;
}

.category-tile span,
.category-tile small,
.category-panel div {
    position: absolute;
    z-index: 2;
    left: 18px;
    right: 18px;
}

.category-tile span {
    bottom: 54px;
    color: #fff;
    font-weight: 900;
    font-size: 20px;
}

.category-tile small {
    bottom: 18px;
    color: #dbeafe;
    line-height: 1.4;
}

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

.compact-card {
    display: block;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.compact-card img {
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.compact-card span {
    display: block;
    padding: 12px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-hero {
    margin-top: 32px;
    border-radius: 30px;
    min-height: 280px;
    display: flex;
    align-items: center;
    color: #fff;
    background: radial-gradient(circle at 15% 15%, rgba(34, 211, 238, 0.24), transparent 32%), linear-gradient(135deg, #020617, #0f172a 48%, #064e3b);
    box-shadow: var(--shadow);
}

.page-hero > div {
    max-width: 780px;
    padding: 46px 0;
}

.page-hero h1 {
    color: #fff;
    font-size: clamp(36px, 6vw, 58px);
    line-height: 1.1;
}

.page-hero p {
    margin: 14px 0 0;
    color: #dbeafe;
    font-size: 17px;
}

.small-hero {
    min-height: 240px;
}

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

.category-panel {
    min-height: 240px;
}

.category-panel div {
    bottom: 24px;
    color: #fff;
}

.category-panel h2 {
    margin: 0 0 8px;
    font-size: 28px;
}

.category-panel p {
    margin: 0 0 14px;
    color: #dbeafe;
}

.category-panel span {
    color: #67e8f9;
    font-weight: 800;
}

.toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px;
    margin-bottom: 24px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.toolbar input,
.toolbar select {
    color: #0f172a;
    background: #f8fafc;
    border-color: #dbe3ef;
}

.toolbar input {
    min-width: 280px;
    flex: 1;
}

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

.ranking-row {
    display: grid;
    grid-template-columns: 70px 130px 1fr auto;
    gap: 18px;
    align-items: center;
    border-radius: 22px;
    padding: 14px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.rank-number {
    color: var(--green-dark);
    font-size: 28px;
    font-weight: 900;
    text-align: center;
}

.rank-cover {
    overflow: hidden;
    border-radius: 16px;
    aspect-ratio: 16 / 10;
    background: #0f172a;
}

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

.rank-info h3,
.rank-info p {
    margin: 0;
}

.rank-info h3 {
    font-size: 21px;
}

.rank-info p {
    margin-top: 6px;
    color: var(--muted);
}

.rank-meta {
    margin-top: 10px;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    min-height: 560px;
    color: #fff;
    background: #020617;
}

.detail-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    opacity: 0.52;
    filter: blur(1px);
    transform: scale(1.02);
}

.detail-bg-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.68), rgba(2, 6, 23, 0.9)), linear-gradient(0deg, #020617, transparent 65%);
}

.detail-wrap {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 42px;
    align-items: center;
    min-height: 560px;
}

.detail-poster {
    overflow: hidden;
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.detail-poster img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 16px;
    color: #a7f3d0;
    font-weight: 700;
}

.detail-info h1 {
    color: #fff;
    font-size: clamp(36px, 6vw, 62px);
    line-height: 1.08;
}

.detail-one-line {
    margin: 18px 0;
    max-width: 780px;
    color: #e0f2fe;
    font-size: 18px;
}

.detail-meta span {
    color: #e0f2fe;
    background: rgba(15, 23, 42, 0.45);
}

.detail-tags span {
    color: #d1fae5;
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(52, 211, 153, 0.22);
}

.detail-info .primary-button {
    margin-top: 22px;
}

.player-section {
    padding-top: 48px;
}

.video-player {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: #020617;
    box-shadow: 0 28px 80px rgba(2, 6, 23, 0.35);
    aspect-ratio: 16 / 9;
}

.video-player video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #020617;
    cursor: pointer;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    border: 0;
    color: #fff;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.32), rgba(2, 6, 23, 0.72));
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-circle {
    width: 86px;
    height: 86px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-left: 6px;
    color: #052e2b;
    background: linear-gradient(135deg, #34d399, #22d3ee);
    font-size: 32px;
    box-shadow: 0 16px 40px rgba(16, 185, 129, 0.32);
}

.player-overlay strong {
    max-width: min(760px, 86vw);
    font-size: clamp(22px, 4vw, 40px);
    text-align: center;
}

.detail-text {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    border-radius: 28px;
    margin-top: 38px;
    padding-top: 34px;
    padding-bottom: 34px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.detail-text h2 {
    font-size: 28px;
}

.detail-text p {
    margin: 0 0 12px;
    color: #334155;
    font-size: 17px;
}

.site-footer {
    margin-top: 64px;
    color: #cbd5e1;
    background: linear-gradient(135deg, #020617, #0f172a);
}

.footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 46px 24px;
}

.footer-brand {
    color: #fff;
    font-size: 22px;
}

.footer-inner p {
    max-width: 700px;
    color: #94a3b8;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 22px 0;
}

.footer-links a {
    color: #d1fae5;
}

.copyright {
    color: #64748b;
    font-size: 14px;
}

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

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

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

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

@media (max-width: 820px) {
    .header-inner {
        height: auto;
        min-height: 64px;
        flex-wrap: wrap;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    .site-nav {
        display: none;
        width: 100%;
        order: 3;
        flex-direction: column;
        align-items: stretch;
        margin-left: 0;
        padding-bottom: 8px;
    }

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

    .nav-link {
        border-radius: 14px;
    }

    .hero {
        height: 76vh;
        min-height: 560px;
    }

    .hero-content {
        bottom: 78px;
    }

    .hero-arrow {
        display: none;
    }

    .search-hero-panel {
        grid-template-columns: 1fr;
        margin-top: 0;
        border-radius: 0;
    }

    .wide-search {
        justify-content: stretch;
        flex-direction: column;
        align-items: stretch;
    }

    .wide-search input {
        min-width: 0;
        width: 100%;
    }

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

    .movie-grid,
    .featured-grid,
    .related-grid,
    .catalog-grid,
    .category-grid,
    .category-panel-grid,
    .compact-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ranking-row {
        grid-template-columns: 48px 96px 1fr;
    }

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

    .detail-wrap {
        grid-template-columns: 1fr;
        padding-top: 42px;
        padding-bottom: 42px;
    }

    .detail-poster {
        width: min(320px, 76vw);
    }
}

@media (max-width: 540px) {
    .brand-text {
        font-size: 18px;
    }

    .hero h1,
    .detail-info h1,
    .page-hero h1 {
        font-size: 36px;
    }

    .movie-grid,
    .featured-grid,
    .related-grid,
    .catalog-grid,
    .category-grid,
    .category-panel-grid,
    .compact-strip {
        grid-template-columns: 1fr;
    }

    .content-section,
    .page-hero,
    .detail-wrap,
    .search-hero-panel {
        padding-left: 16px;
        padding-right: 16px;
    }

    .ranking-row {
        grid-template-columns: 42px 84px 1fr;
        gap: 10px;
    }

    .rank-info h3 {
        font-size: 17px;
    }

    .rank-info p {
        display: none;
    }

    .toolbar {
        flex-direction: column;
    }

    .toolbar input,
    .toolbar select {
        width: 100%;
        min-width: 0;
    }
}
