:root {
    --color-primary: 31 111 235;
    --color-primary-dark: 24 90 188;
    --color-secondary: 52 211 153;
    --color-accent: 251 146 60;
    --color-text-primary: 15 23 42;
    --color-text-secondary: 71 85 105;
    --color-text-muted: 148 163 184;
    --color-bg-primary: 255 255 255;
    --color-bg-secondary: 248 250 252;
    --color-bg-tertiary: 241 245 249;
    --color-border: 226 232 240;
    --shadow-soft: 0 18px 55px rgba(15, 23, 42, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: rgb(var(--color-bg-secondary));
    color: rgb(var(--color-text-primary));
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid rgba(var(--color-border), 0.75);
    backdrop-filter: blur(18px);
}

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

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

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 14px;
    background: linear-gradient(135deg, rgb(var(--color-primary)), rgb(var(--color-secondary)));
    box-shadow: 0 14px 30px rgba(31, 111, 235, 0.28);
}

.desktop-nav,
.footer-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.desktop-nav a,
.footer-links a,
.mobile-nav a {
    padding: 9px 12px;
    border-radius: 999px;
    color: rgb(var(--color-text-secondary));
    font-size: 14px;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.footer-links a:hover,
.mobile-nav a:hover {
    color: rgb(var(--color-primary));
    background: rgba(31, 111, 235, 0.08);
}

.nav-toggle {
    width: 42px;
    height: 42px;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid rgba(var(--color-border), 0.95);
    border-radius: 14px;
    background: #fff;
}

.nav-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 99px;
    background: rgb(var(--color-text-primary));
}

.mobile-nav {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 14px;
    padding: 12px;
    border: 1px solid rgba(var(--color-border), 0.85);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.focus-wrap {
    position: relative;
    overflow: hidden;
    min-height: 640px;
    padding: 72px 0;
    isolation: isolate;
}

.focus-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-size: cover;
    background-position: center;
    transform: scale(1.06);
    filter: saturate(1.05);
    transition: background-image 0.45s ease;
}

.focus-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 75% 25%, rgba(52, 211, 153, 0.28), transparent 30%),
        linear-gradient(90deg, rgba(248, 250, 252, 0.98), rgba(248, 250, 252, 0.9) 42%, rgba(248, 250, 252, 0.5));
}

.focus-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 460px;
    align-items: center;
    gap: 54px;
}

.section-kicker {
    margin: 0 0 10px;
    color: rgb(var(--color-primary));
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.focus-copy h1,
.sub-hero h1,
.detail-copy h1 {
    margin: 0;
    font-size: clamp(34px, 6vw, 64px);
    line-height: 1.08;
    letter-spacing: -0.06em;
}

.focus-copy p,
.sub-hero p,
.detail-line {
    max-width: 680px;
    margin: 20px 0 0;
    color: rgb(var(--color-text-secondary));
    font-size: 17px;
    line-height: 1.85;
}

.focus-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

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

.primary-link {
    padding: 13px 22px;
    color: #fff;
    background: linear-gradient(135deg, rgb(var(--color-primary)), rgb(var(--color-primary-dark)));
    box-shadow: 0 18px 36px rgba(31, 111, 235, 0.28);
}

.ghost-link {
    padding: 13px 22px;
    color: rgb(var(--color-primary));
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(31, 111, 235, 0.18);
}

.text-link {
    color: rgb(var(--color-primary));
}

.primary-link:hover,
.ghost-link:hover,
.movie-card:hover,
.category-card:hover,
.rank-item:hover {
    transform: translateY(-3px);
}

.home-search,
.filter-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px 150px;
    gap: 10px;
    width: min(660px, 100%);
    margin-top: 34px;
    padding: 10px;
    border: 1px solid rgba(var(--color-border), 0.9);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

.home-search input,
.home-search select,
.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    color: rgb(var(--color-text-primary));
    border: 1px solid rgba(var(--color-border), 0.75);
    border-radius: 15px;
    outline: none;
    background: #fff;
}

.focus-panel {
    position: relative;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.66);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(22px);
}

.focus-slide {
    display: none;
}

.focus-slide.is-active {
    display: block;
    animation: fadeUp 0.4s ease both;
}

.focus-poster {
    min-height: 300px;
    border-radius: 26px;
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 -120px 120px rgba(15, 23, 42, 0.52);
}

.focus-info {
    padding: 18px 8px 6px;
}

.focus-info span {
    display: inline-flex;
    margin-bottom: 8px;
    color: rgb(var(--color-accent));
    font-size: 13px;
    font-weight: 800;
}

.focus-info h2 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.03em;
}

.focus-info p {
    margin: 10px 0 0;
    color: rgb(var(--color-text-secondary));
    line-height: 1.75;
}

.focus-dots {
    display: flex;
    gap: 8px;
    padding: 12px 8px 2px;
}

.focus-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(31, 111, 235, 0.22);
}

.focus-dot.is-active {
    width: 34px;
    background: rgb(var(--color-primary));
}

.section-block {
    padding: 48px 0;
}

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

.section-title-row h2 {
    margin: 0;
    font-size: clamp(26px, 4vw, 40px);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

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

.category-card {
    min-height: 142px;
    padding: 22px;
    border: 1px solid rgba(var(--color-border), 0.8);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 100% 0, rgba(31, 111, 235, 0.16), transparent 32%),
        #fff;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card span {
    display: block;
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: 900;
}

.category-card p {
    margin: 0;
    color: rgb(var(--color-text-secondary));
    font-size: 14px;
    line-height: 1.7;
}

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(var(--color-border), 0.86);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.movie-cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    background-size: cover;
    background-position: center;
    background-color: rgb(var(--color-bg-tertiary));
}

.movie-cover::after,
.rank-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 25%, rgba(15, 23, 42, 0.72));
}

.movie-badge,
.movie-play {
    position: absolute;
    z-index: 1;
}

.movie-badge {
    top: 12px;
    left: 12px;
    padding: 6px 10px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(10px);
}

.movie-play {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 50%;
    background: linear-gradient(135deg, rgb(var(--color-primary)), rgb(var(--color-secondary)));
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.24);
}

.movie-body {
    padding: 18px;
}

.movie-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: rgb(var(--color-text-muted));
    font-size: 12px;
    font-weight: 700;
}

.movie-meta span,
.detail-meta span {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
}

.movie-body h3 {
    margin: 12px 0 8px;
    font-size: 19px;
    line-height: 1.35;
}

.movie-body p {
    display: -webkit-box;
    min-height: 48px;
    margin: 0;
    overflow: hidden;
    color: rgb(var(--color-text-secondary));
    font-size: 14px;
    line-height: 1.7;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-tags,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.movie-tags span {
    padding: 5px 9px;
    color: rgb(var(--color-primary));
    font-size: 12px;
    font-weight: 750;
    border-radius: 999px;
    background: rgba(31, 111, 235, 0.08);
}

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

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

.rank-item {
    display: grid;
    grid-template-columns: 52px 110px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(var(--color-border), 0.86);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease;
}

.rank-index {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: rgb(var(--color-primary));
    font-size: 18px;
    font-weight: 900;
    border-radius: 14px;
    background: rgba(31, 111, 235, 0.08);
}

.rank-cover {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    border-radius: 16px;
    background-size: cover;
    background-position: center;
}

.rank-copy h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.rank-copy p {
    margin: 0 0 10px;
    color: rgb(var(--color-text-secondary));
    font-size: 14px;
    line-height: 1.65;
}

.sub-hero {
    position: relative;
    padding: 68px 0 42px;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 0, rgba(52, 211, 153, 0.2), transparent 28%),
        radial-gradient(circle at 88% 18%, rgba(31, 111, 235, 0.18), transparent 30%),
        linear-gradient(180deg, #fff, rgb(var(--color-bg-secondary)));
}

.category-hero {
    padding-bottom: 36px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    margin-bottom: 22px;
    color: rgb(var(--color-text-muted));
    font-size: 14px;
}

.breadcrumb a {
    color: rgb(var(--color-primary));
    font-weight: 750;
}

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

.category-card.large {
    min-height: 170px;
}

.detail-head {
    position: relative;
    overflow: hidden;
    padding: 56px 0;
    background-size: cover;
    background-position: center;
    isolation: isolate;
}

.detail-shade {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(248, 250, 252, 0.98), rgba(248, 250, 252, 0.88) 50%, rgba(248, 250, 252, 0.7)),
        radial-gradient(circle at 75% 20%, rgba(31, 111, 235, 0.2), transparent 38%);
    backdrop-filter: blur(5px);
}

.detail-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 42px;
    align-items: center;
}

.detail-poster {
    min-height: 430px;
    border-radius: 30px;
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-soft);
}

.detail-copy h1 {
    font-size: clamp(36px, 5vw, 58px);
}

.detail-meta {
    margin-top: 20px;
}

.player-section {
    padding: 52px 0 20px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: #020617;
    box-shadow: 0 28px 70px rgba(2, 6, 23, 0.28);
}

.player-shell video {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    background: #020617;
}

.player-start {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 12px;
    color: #fff;
    border: 0;
    background:
        radial-gradient(circle at center, rgba(31, 111, 235, 0.18), rgba(2, 6, 23, 0.66)),
        linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.72));
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-start span {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, rgb(var(--color-primary)), rgb(var(--color-secondary)));
    box-shadow: 0 20px 44px rgba(31, 111, 235, 0.35);
}

.player-start strong {
    font-size: 18px;
}

.player-shell.is-playing .player-start {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.story-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    padding: 28px 0;
}

.text-panel {
    padding: 26px;
    border: 1px solid rgba(var(--color-border), 0.86);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.text-panel h2 {
    margin: 0 0 14px;
    font-size: 24px;
}

.text-panel p {
    margin: 0;
    color: rgb(var(--color-text-secondary));
    line-height: 1.9;
}

.related-section {
    padding: 30px 0 64px;
}

.empty-state {
    display: none;
    padding: 28px;
    color: rgb(var(--color-text-secondary));
    text-align: center;
    border: 1px dashed rgba(var(--color-border), 1);
    border-radius: 20px;
    background: #fff;
}

.empty-state.is-visible {
    display: block;
}

.site-footer {
    margin-top: 30px;
    padding: 42px 0;
    border-top: 1px solid rgba(var(--color-border), 0.86);
    background: #fff;
}

.footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
}

.footer-inner p {
    margin: 12px 0 0;
    color: rgb(var(--color-text-secondary));
    line-height: 1.8;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    .nav-toggle {
        display: flex;
    }

    body.nav-open .mobile-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .focus-wrap {
        min-height: auto;
        padding: 42px 0;
    }

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

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

    .detail-poster {
        min-height: 360px;
    }
}

@media (max-width: 640px) {
    .container,
    .header-inner,
    .footer-inner,
    .mobile-nav {
        width: min(100% - 24px, 1180px);
    }

    .header-inner {
        height: 64px;
    }

    .focus-copy h1,
    .sub-hero h1,
    .detail-copy h1 {
        font-size: 34px;
    }

    .focus-panel {
        padding: 10px;
        border-radius: 24px;
    }

    .focus-poster {
        min-height: 220px;
        border-radius: 18px;
    }

    .category-grid,
    .movie-grid,
    .compact-grid,
    .rank-grid,
    .overview-grid {
        grid-template-columns: 1fr;
    }

    .rank-item {
        grid-template-columns: 42px 88px minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .rank-copy p {
        display: none;
    }

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

    .detail-poster {
        min-height: 300px;
    }
}
