:root {
    --sky: #0284c7;
    --sky-light: #0ea5e9;
    --orange: #f97316;
    --ink: #111827;
    --muted: #64748b;
    --line: #e5e7eb;
    --paper: #ffffff;
    --soft: #f8fafc;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 42%, #fff7ed 100%);
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

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

.nav-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: 0.02em;
}

.logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--sky-light), var(--orange));
    box-shadow: 0 10px 24px rgba(14, 165, 233, 0.25);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link,
.nav-sub-link {
    padding: 10px 14px;
    border-radius: 999px;
    color: #334155;
    font-weight: 650;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.nav-sub-link:hover {
    color: var(--sky);
    background: #e0f2fe;
}

.nav-sub {
    display: flex;
    gap: 6px;
    margin-left: 8px;
}

.nav-sub-link {
    font-size: 13px;
    color: #64748b;
}

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

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

.hero {
    position: relative;
    height: clamp(520px, 72vw, 700px);
    overflow: hidden;
    background: #020617;
}

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

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

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

.hero-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.45) 45%, rgba(0, 0, 0, 0.1) 100%);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100vw - 1180px) / 2));
    bottom: 74px;
    width: min(760px, calc(100% - 48px));
    color: #fff;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.hero-kicker span,
.poster-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--orange);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.hero-kicker strong {
    color: #facc15;
    font-size: 18px;
}

.hero h1 {
    margin: 0 0 16px;
    font-size: clamp(34px, 6vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero p {
    margin: 0 0 16px;
    max-width: 720px;
    color: #e5e7eb;
    font-size: clamp(16px, 2vw, 20px);
}

.hero-meta {
    color: #cbd5e1;
    margin-bottom: 28px;
}

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

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

.btn:hover {
    transform: translateY(-2px) scale(1.01);
}

.btn-primary {
    color: #fff;
    background: var(--sky);
    box-shadow: 0 18px 30px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
    background: #0369a1;
}

.btn-ghost,
.btn-soft {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(10px);
}

.btn-soft {
    background: rgba(249, 115, 22, 0.85);
}

.hero-control {
    position: absolute;
    top: 50%;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.hero-control:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-50%) scale(1.05);
}

.hero-prev {
    left: 24px;
    transform: translateY(-50%);
}

.hero-next {
    right: 24px;
    transform: translateY(-50%);
}

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

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

.hero-dot.is-active {
    width: 36px;
    background: #fff;
}

.home-search,
.category-strip,
.content-section,
.page-main,
.detail-content,
.player-section,
.related-section,
.rank-list {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.home-search {
    margin-top: -44px;
    position: relative;
    z-index: 5;
}

.home-search-inner,
.content-section,
.category-strip,
.story-card,
.player-section,
.rank-list,
.category-overview-grid {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.home-search-inner {
    padding: 26px;
}

.home-search h2,
.section-head h2,
.story-card h2,
.page-hero h1,
.rank-info h2 {
    margin: 0;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(130px, 180px));
    gap: 12px;
    margin: 18px 0 24px;
}

.search-input,
.filter-select {
    width: 100%;
    min-height: 46px;
    padding: 0 15px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus,
.filter-select:focus {
    border-color: var(--sky-light);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.category-strip,
.content-section {
    padding: 34px;
    margin-top: 54px;
}

.section-tinted {
    background: linear-gradient(135deg, #f0f9ff 0%, #fff7ed 100%);
}

.flat-section {
    box-shadow: none;
    background: transparent;
    border: 0;
    padding: 0;
}

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

.section-head h2 {
    font-size: clamp(24px, 4vw, 34px);
    letter-spacing: -0.03em;
}

.section-more {
    color: var(--sky);
    font-weight: 800;
}

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

.category-pill,
.category-card {
    display: block;
    min-height: 130px;
    padding: 20px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-pill:hover,
.category-card:hover,
.movie-card:hover,
.rank-row:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 45px rgba(15, 23, 42, 0.16);
}

.category-pill strong,
.category-card h2 {
    display: block;
    margin-bottom: 8px;
    font-size: 20px;
}

.category-pill span,
.category-card p {
    color: var(--muted);
    font-size: 14px;
}

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

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

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

.movie-card {
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.09);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card-link {
    display: block;
    height: 100%;
}

.poster-wrap {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: #020617;
}

.card-large .poster-wrap {
    height: 310px;
}

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

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

.poster-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.05) 62%);
    opacity: 0.75;
}

.poster-badge,
.poster-score,
.rank-tag {
    position: absolute;
    z-index: 2;
}

.poster-badge {
    top: 12px;
    right: 12px;
}

.poster-score {
    left: 12px;
    bottom: 12px;
    color: #facc15;
    font-weight: 800;
    z-index: 2;
}

.rank-tag {
    left: 12px;
    top: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--sky);
    color: #fff;
    font-weight: 800;
    font-size: 12px;
}

.poster-play {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    width: 62px;
    height: 62px;
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--sky);
    background: rgba(255, 255, 255, 0.92);
    font-size: 24px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .poster-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

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

.movie-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

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

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

.page-main {
    padding: 48px 0 72px;
}

.page-hero {
    margin-bottom: 34px;
    padding: 46px;
    border-radius: 32px;
    color: #fff;
    background: linear-gradient(135deg, #0f172a 0%, #0284c7 62%, #f97316 100%);
    box-shadow: var(--shadow);
}

.page-hero h1 {
    font-size: clamp(34px, 6vw, 58px);
    letter-spacing: -0.04em;
}

.page-hero p {
    margin: 12px 0 0;
    max-width: 760px;
    color: rgba(255, 255, 255, 0.86);
}

.compact-hero .filter-panel {
    margin-bottom: 0;
}

.category-overview-grid {
    padding: 30px;
}

.category-card {
    min-height: 100%;
    padding: 0;
    overflow: hidden;
}

.category-card-posters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 130px;
    background: #020617;
}

.category-card-posters img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card-body {
    padding: 20px;
}

.category-card-body span {
    color: var(--sky);
    font-weight: 800;
}

.detail-main {
    padding-bottom: 72px;
}

.detail-hero {
    min-height: 560px;
    background-position: center;
    background-size: cover;
    color: #fff;
}

.detail-hero-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 560px;
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 42px;
    align-items: center;
}

.detail-cover {
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 28px 50px rgba(0, 0, 0, 0.38);
}

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

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    margin-bottom: 16px;
    font-size: 14px;
}

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

.detail-info h1 {
    margin: 0 0 14px;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.detail-one-line {
    max-width: 790px;
    color: #e2e8f0;
    font-size: 18px;
}

.detail-meta,
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.detail-meta span,
.tag-list span {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    backdrop-filter: blur(10px);
    font-weight: 700;
}

.player-section {
    margin-top: 54px;
    padding: 32px;
}

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

.movie-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #020617;
}

.player-overlay {
    position: absolute;
    inset: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.2));
    cursor: pointer;
    z-index: 3;
}

.player-overlay.is-hidden {
    display: none;
}

.player-circle {
    width: 78px;
    height: 78px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--sky);
    background: rgba(255, 255, 255, 0.94);
    font-size: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.24);
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 34px;
}

.story-card {
    padding: 28px;
}

.story-card p {
    margin: 14px 0 0;
    color: #334155;
}

.info-grid-card {
    grid-column: span 2;
}

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

.info-grid div {
    padding: 16px;
    border-radius: 16px;
    background: #f8fafc;
}

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

.info-grid dd {
    margin: 5px 0 0;
    font-weight: 800;
}

.related-section {
    margin-top: 34px;
}

.rank-list {
    padding: 22px;
}

.rank-row {
    display: grid;
    grid-template-columns: 60px 92px minmax(0, 1fr) 86px;
    align-items: center;
    gap: 18px;
    padding: 14px;
    border-radius: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-row + .rank-row {
    border-top: 1px solid #e2e8f0;
}

.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--sky), var(--orange));
    font-weight: 900;
}

.rank-cover {
    border-radius: 14px;
    overflow: hidden;
}

.rank-cover img {
    width: 92px;
    height: 120px;
    object-fit: cover;
}

.rank-info p,
.rank-info span {
    margin: 5px 0;
    color: var(--muted);
}

.rank-score {
    color: #f59e0b;
    font-size: 20px;
    justify-self: end;
}

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

[hidden] {
    display: none !important;
}

.site-footer {
    margin-top: 64px;
    padding: 36px 0;
    border-top: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.84);
}

.footer-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #64748b;
}

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

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

    .detail-hero-inner {
        grid-template-columns: 250px minmax(0, 1fr);
    }

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

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

    .main-nav {
        position: absolute;
        top: 72px;
        left: 16px;
        right: 16px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: var(--shadow);
    }

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

    .nav-sub {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        margin-left: 0;
    }

    .hero {
        height: 620px;
    }

    .hero-content {
        bottom: 88px;
    }

    .hero-control {
        display: none;
    }

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

    .category-strip,
    .content-section,
    .home-search-inner,
    .page-hero,
    .player-section,
    .story-card,
    .category-overview-grid {
        padding: 22px;
        border-radius: 22px;
    }

    .poster-wrap,
    .card-large .poster-wrap {
        height: 230px;
    }

    .detail-hero-inner {
        grid-template-columns: 1fr;
        padding: 34px 0;
    }

    .detail-cover {
        width: min(240px, 74vw);
    }

    .detail-content,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-grid-card {
        grid-column: span 1;
    }

    .rank-row {
        grid-template-columns: 44px 78px minmax(0, 1fr);
    }

    .rank-score {
        grid-column: 3;
        justify-self: start;
    }

    .footer-shell {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .movie-grid,
    .mini-grid,
    .grid-three,
    .category-pill-grid,
    .category-overview-grid {
        grid-template-columns: 1fr;
    }

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

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

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

    .poster-wrap,
    .card-large .poster-wrap {
        height: 280px;
    }
}
