:root {
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --primary-soft: #e0f2fe;
    --accent: #f59e0b;
    --accent-soft: #fef3c7;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --surface: #ffffff;
    --background: #f8fafc;
    --dark: #0f172a;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

body.nav-open {
    overflow: hidden;
}

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

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    backdrop-filter: blur(16px);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    min-height: 72px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #38bdf8);
    color: #ffffff;
    font-size: 15px;
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.28);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
}

.main-nav a {
    padding: 10px 14px;
    border-radius: 12px;
    color: #334155;
    white-space: nowrap;
    transition: 0.2s ease;
}

.main-nav a:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #f1f5f9;
    padding: 10px;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: #0f172a;
    margin: 5px 0;
    border-radius: 999px;
}

.hero-carousel {
    position: relative;
    height: 76vh;
    min-height: 560px;
    overflow: hidden;
    background: #020617;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.7s ease, transform 1s ease;
    pointer-events: none;
}

.hero-slide.is-active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.hero-image,
.detail-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay,
.detail-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.48), rgba(2, 6, 23, 0.1));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px 92px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
}

.hero-label,
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.hero-content h1 {
    max-width: 820px;
    margin: 0 0 18px;
    color: #ffffff;
    font-size: clamp(42px, 7vw, 84px);
    line-height: 1.02;
    font-weight: 900;
    letter-spacing: -0.05em;
}

.hero-content p {
    max-width: 720px;
    margin: 0 0 24px;
    color: #e2e8f0;
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.65;
}

.hero-tags,
.detail-tags,
.movie-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags span,
.detail-tags span {
    display: inline-flex;
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.primary-button,
.ghost-button,
.section-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 14px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 18px 32px rgba(2, 132, 199, 0.28);
}

.primary-button:hover,
.section-more:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
    color: #ffffff;
}

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

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

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

.hero-dot.is-active {
    width: 34px;
    background: #ffffff;
}

.content-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 72px 24px;
}

.gradient-section {
    max-width: none;
    padding-left: max(24px, calc((100vw - 1280px) / 2 + 24px));
    padding-right: max(24px, calc((100vw - 1280px) / 2 + 24px));
    background: linear-gradient(135deg, #eff6ff, #e0f2fe);
}

.dark-section {
    max-width: none;
    padding-left: max(24px, calc((100vw - 1280px) / 2 + 24px));
    padding-right: max(24px, calc((100vw - 1280px) / 2 + 24px));
    background: var(--dark);
    color: #ffffff;
}

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

.section-head h2,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.12;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.section-head p,
.page-hero p {
    max-width: 760px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.8;
}

.dark-section .section-head p,
.dark-section .eyebrow {
    color: #bae6fd;
}

.section-more {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

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

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

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

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

.movie-card {
    display: block;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
    transition: 0.25s ease;
}

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

.movie-cover {
    position: relative;
    margin: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}

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

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

.movie-duration {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    font-size: 12px;
}

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

.movie-meta-line,
.detail-meta,
.ranking-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--muted);
    font-size: 13px;
}

.movie-region {
    padding: 4px 8px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 800;
}

.movie-card h3 {
    min-height: 46px;
    margin: 12px 0 8px;
    font-size: 18px;
    line-height: 1.3;
    color: var(--text);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.movie-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.movie-tags {
    margin-top: 14px;
}

.movie-tags span {
    padding: 4px 8px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
}

.movie-card-horizontal {
    display: grid;
    grid-template-columns: 190px 1fr;
}

.movie-card-horizontal .movie-cover {
    height: 100%;
    aspect-ratio: auto;
}

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

.category-panel {
    min-height: 178px;
    padding: 24px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #ffffff, #f0f9ff);
    border: 1px solid var(--line);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
    transition: 0.2s ease;
}

.category-panel:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.category-panel span {
    color: var(--primary-dark);
    font-weight: 900;
    font-size: 22px;
}

.category-panel strong {
    display: block;
    margin-top: 16px;
    font-size: 32px;
}

.category-panel p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.ranking-list,
.ranking-cards {
    display: grid;
    gap: 14px;
}

.ranking-row,
.ranking-card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 120px 90px;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.rank-number,
.rank-badge {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--accent);
    color: #111827;
    font-weight: 900;
}

.rank-title {
    font-weight: 800;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ranking-card {
    grid-template-columns: 60px 148px 1fr;
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.ranking-card img {
    width: 148px;
    height: 100px;
    object-fit: cover;
    border-radius: 14px;
    background: #e2e8f0;
}

.ranking-card h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.ranking-card p {
    margin: 0 0 12px;
    color: var(--muted);
    line-height: 1.6;
}

.page-hero {
    min-height: 360px;
    padding: 96px 24px 64px;
    display: flex;
    align-items: end;
    background: radial-gradient(circle at top left, #bae6fd, transparent 32%), linear-gradient(135deg, #eff6ff, #ffffff);
}

.page-hero > div {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

.small-hero,
.category-hero,
.search-hero,
.ranking-hero {
    min-height: 300px;
}

.filter-bar {
    max-width: 1280px;
    margin: -36px auto 0;
    padding: 20px;
    display: grid;
    grid-template-columns: 2fr repeat(2, 1fr);
    gap: 14px;
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.search-filter {
    grid-template-columns: 2fr repeat(4, 1fr);
}

.filter-bar input,
.filter-bar select {
    min-height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0 14px;
    background: #ffffff;
    color: var(--text);
    outline: none;
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}

.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--muted);
}

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

.detail-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    min-height: 650px;
    margin: 0 auto;
    padding: 80px 24px 54px;
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 42px;
    align-items: end;
}

.detail-poster {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
    background: #1e293b;
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.detail-info {
    color: #ffffff;
}

.detail-info h1 {
    margin-bottom: 18px;
    color: #ffffff;
}

.detail-one-line {
    max-width: 820px;
    margin: 0 0 22px;
    color: #e2e8f0;
    font-size: 20px;
    line-height: 1.8;
}

.detail-meta span,
.detail-meta strong {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.detail-tags {
    margin: 24px 0;
}

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

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    border: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.25));
    color: #ffffff;
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-circle {
    width: 84px;
    height: 84px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    font-size: 34px;
    box-shadow: 0 18px 38px rgba(2, 132, 199, 0.45);
}

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

.detail-article,
.detail-side {
    padding: 30px;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.detail-article h2,
.detail-side h2 {
    margin: 0 0 16px;
    font-size: 24px;
}

.detail-article p {
    margin: 0 0 28px;
    color: #334155;
    line-height: 2;
    font-size: 17px;
}

.detail-side dl {
    margin: 0;
    display: grid;
    gap: 12px;
}

.detail-side dt {
    color: var(--muted);
    font-size: 13px;
}

.detail-side dd {
    margin: -8px 0 8px;
    font-weight: 800;
}

.site-footer {
    background: var(--dark);
    color: #cbd5e1;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 54px 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 38px;
}

.footer-logo {
    color: #ffffff;
}

.footer-brand p {
    max-width: 560px;
    color: #94a3b8;
    line-height: 1.8;
}

.site-footer h2 {
    margin: 0 0 16px;
    color: #ffffff;
    font-size: 18px;
}

.site-footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.site-footer a:hover {
    color: #38bdf8;
}

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

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

@media (max-width: 860px) {
    .nav-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        max-height: calc(100vh - 72px);
        padding: 16px 24px 28px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        background: #ffffff;
        border-bottom: 1px solid var(--line);
        overflow-y: auto;
    }

    body.nav-open .main-nav {
        display: flex;
    }

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

    .hero-content {
        padding-bottom: 78px;
    }

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

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

    .filter-bar,
    .search-filter {
        margin: 18px 24px 0;
        grid-template-columns: 1fr;
    }

    .detail-hero-inner {
        grid-template-columns: 1fr;
        align-items: center;
    }

    .detail-poster {
        width: min(320px, 80vw);
        margin-top: 30px;
    }

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

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

    .ranking-row span:nth-child(3),
    .ranking-row strong {
        display: none;
    }

    .ranking-card img {
        display: none;
    }
}

@media (max-width: 560px) {
    .header-inner,
    .hero-content,
    .content-section,
    .gradient-section,
    .dark-section,
    .page-hero,
    .detail-hero-inner,
    .footer-inner {
        padding-left: 16px;
        padding-right: 16px;
    }

    .site-brand {
        font-size: 18px;
    }

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

    .hero-content h1 {
        font-size: 38px;
    }

    .hero-content p,
    .detail-one-line {
        font-size: 16px;
    }

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

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

    .detail-hero,
    .detail-hero-inner {
        min-height: auto;
    }

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