* {
    box-sizing: border-box;
}

:root {
    --color-ocean-50: #f0f9ff;
    --color-ocean-100: #e0f2fe;
    --color-ocean-400: #38bdf8;
    --color-ocean-600: #0284c7;
    --color-ocean-700: #0369a1;
    --color-island-50: #f0fdf4;
    --color-island-600: #16a34a;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-900: #111827;
    --shadow-soft: 0 2px 15px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius-2xl: 1rem;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--color-gray-900);
    background: var(--color-gray-50);
}

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.95);
    backdrop-filter: blur(4px);
    box-shadow: var(--shadow-soft);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 80rem;
    height: 4rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--color-ocean-600), var(--color-island-600));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    color: #ffffff;
    font-size: 0.85rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-ocean-600), var(--color-island-600));
    box-shadow: var(--shadow-soft);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 1.6rem;
}

.desktop-nav a,
.mobile-nav a {
    color: var(--color-gray-600);
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.2s ease, background 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active {
    color: var(--color-ocean-600);
}

.mobile-menu-button {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 0.75rem;
    background: transparent;
    cursor: pointer;
}

.mobile-menu-button span {
    display: block;
    width: 1.35rem;
    height: 2px;
    margin: 4px auto;
    background: var(--color-gray-600);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-button.is-open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-menu-button.is-open span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-button.is-open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.mobile-nav {
    display: none;
    border-top: 1px solid var(--color-gray-100);
    background: #ffffff;
    padding: 0.7rem 1rem 1rem;
}

.mobile-nav a {
    display: block;
    max-width: 80rem;
    margin: 0.15rem auto;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
}

.mobile-nav a:hover,
.mobile-nav a.active {
    background: var(--color-ocean-50);
}

.mobile-nav.is-open {
    display: block;
}

.hero-section {
    max-width: 80rem;
    margin: 1rem auto 0;
    padding: 0 1rem;
}

.hero-card {
    position: relative;
    display: block;
    height: 70vh;
    min-height: 500px;
    overflow: hidden;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-soft);
    isolation: isolate;
}

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

.hero-card:hover img {
    transform: scale(1.06);
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.28), transparent);
}

.hero-content {
    position: absolute;
    right: 2rem;
    bottom: 2rem;
    left: 2rem;
    max-width: 52rem;
    color: #ffffff;
}

.hero-eyebrow,
.section-kicker {
    margin: 0 0 0.8rem;
    color: var(--color-ocean-400);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-content h1 {
    margin: 0 0 0.65rem;
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.hero-content h2 {
    margin: 0 0 0.8rem;
    font-size: clamp(1.6rem, 3vw, 3rem);
}

.hero-content p {
    max-width: 44rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.05rem;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.primary-action,
.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0 1.25rem;
    border-radius: 999px;
    font-weight: 800;
}

.primary-action {
    color: var(--color-ocean-700);
    background: #ffffff;
}

.secondary-action {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
}

.content-section {
    padding: 3rem 1rem;
}

.section-alt {
    background: #ffffff;
}

.section-inner {
    max-width: 80rem;
    margin: 0 auto;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-heading h2,
.page-hero h1,
.related-panel h2,
.detail-section h2,
.ranking-side h2 {
    margin: 0;
    color: var(--color-gray-900);
}

.section-heading h2 {
    font-size: clamp(1.8rem, 3vw, 2.35rem);
}

.section-more {
    color: var(--color-ocean-600);
    font-weight: 800;
    white-space: nowrap;
}

.horizontal-list {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0 0 1rem;
    scroll-snap-type: x proximity;
}

.horizontal-list .movie-card {
    flex: 0 0 16rem;
    scroll-snap-align: start;
}

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

.compact-grid {
    gap: 1rem;
}

.movie-card {
    display: block;
    min-width: 0;
}

.poster-frame {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: var(--radius-2xl);
    background: var(--color-gray-200);
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

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

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

.movie-card:hover .poster-frame img {
    transform: scale(1.1);
}

.poster-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.2), transparent);
    opacity: 0.85;
}

.poster-caption {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    color: #ffffff;
}

.poster-caption h3 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.poster-caption p {
    overflow: hidden;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.poster-badge,
.poster-year {
    position: absolute;
    z-index: 2;
    top: 0.8rem;
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: 0 0.65rem;
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    background: rgba(2, 132, 199, 0.88);
    backdrop-filter: blur(6px);
}

.poster-badge {
    left: 0.8rem;
}

.poster-year {
    right: 0.8rem;
    background: rgba(17, 24, 39, 0.64);
}

.movie-card-line {
    display: -webkit-box;
    overflow: hidden;
    margin: 0.75rem 0 0;
    color: var(--color-gray-600);
    font-size: 0.92rem;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.movie-tags {
    overflow: hidden;
    min-height: 1.4rem;
    margin-top: 0.45rem;
    color: var(--color-ocean-700);
    font-size: 0.78rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.rank-item {
    display: grid;
    grid-template-columns: auto 3.8rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.rank-item img {
    width: 3.8rem;
    height: 3.8rem;
    object-fit: cover;
    border-radius: 0.75rem;
}

.rank-number {
    color: var(--color-ocean-600);
    font-size: 1.15rem;
    font-weight: 900;
}

.rank-title {
    overflow: hidden;
    color: var(--color-gray-900);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-meta {
    color: var(--color-gray-500);
    font-size: 0.85rem;
    white-space: nowrap;
}

.page-main {
    padding: 2rem 1rem 4rem;
}

.page-hero {
    max-width: 80rem;
    margin: 0 auto 2rem;
    border-radius: var(--radius-2xl);
    background: linear-gradient(135deg, #ffffff, var(--color-ocean-50) 58%, var(--color-island-50));
    box-shadow: var(--shadow-soft);
}

.slim-hero {
    padding: clamp(2rem, 5vw, 4rem);
}

.page-hero h1 {
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.12;
}

.page-hero p:not(.section-kicker) {
    max-width: 52rem;
    margin: 1rem 0 0;
    color: var(--color-gray-600);
    font-size: 1.05rem;
    line-height: 1.8;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.category-tile {
    position: relative;
    display: block;
    min-height: 14rem;
    overflow: hidden;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-soft);
}

.category-tile img {
    width: 100%;
    height: 100%;
    min-height: 14rem;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.category-tile-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.18));
}

.category-tile-content {
    position: absolute;
    right: 1.2rem;
    bottom: 1.2rem;
    left: 1.2rem;
    color: #ffffff;
}

.category-tile-content h2 {
    margin: 0 0 0.55rem;
    font-size: 1.45rem;
}

.category-tile-content p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.65;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) repeat(3, minmax(8rem, 12rem));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius-2xl);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.search-input-wrap span {
    color: var(--color-ocean-600);
    font-weight: 800;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 2.6rem;
    border: 1px solid var(--color-gray-200);
    border-radius: 0.8rem;
    background: #ffffff;
    color: var(--color-gray-700);
    outline: none;
    padding: 0 0.85rem;
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: var(--color-ocean-400);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.empty-state {
    display: none;
    padding: 3rem 1rem;
    color: var(--color-gray-500);
    text-align: center;
}

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

.ranking-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
    gap: 2rem;
}

.ranking-side {
    position: sticky;
    top: 5.5rem;
    align-self: start;
    padding: 1.25rem;
    border-radius: var(--radius-2xl);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.side-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.detail-main {
    background: var(--color-gray-50);
}

.player-hero {
    padding: 1rem;
    background: #000000;
}

.player-shell {
    position: relative;
    max-width: 80rem;
    margin: 0 auto;
    overflow: hidden;
    border-radius: var(--radius-2xl);
    background: #000000;
    box-shadow: var(--shadow-hover);
}

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

.player-start {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    border: 0;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.32);
    cursor: pointer;
}

.player-start span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    border-radius: 999px;
    color: var(--color-ocean-600);
    background: #ffffff;
    font-size: 2rem;
    box-shadow: var(--shadow-hover);
}

.player-start strong {
    font-size: 1.05rem;
}

.player-shell.is-playing .player-start {
    display: none;
}

.detail-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22rem;
    gap: 2rem;
    max-width: 80rem;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.detail-content,
.related-panel {
    border-radius: var(--radius-2xl);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.detail-content {
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.detail-content h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.12;
}

.detail-one-line {
    margin: 1rem 0 0;
    color: var(--color-gray-600);
    font-size: 1.08rem;
    line-height: 1.8;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1.3rem 0;
}

.detail-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0 0.8rem;
    border-radius: 999px;
    color: var(--color-ocean-700);
    background: var(--color-ocean-50);
    font-size: 0.85rem;
    font-weight: 800;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin: 1.5rem 0 2rem;
}

.info-grid div {
    padding: 1rem;
    border-radius: 1rem;
    background: var(--color-gray-50);
}

.info-grid strong,
.info-grid span {
    display: block;
}

.info-grid strong {
    margin-bottom: 0.35rem;
    color: var(--color-gray-500);
    font-size: 0.8rem;
}

.info-grid span {
    color: var(--color-gray-900);
    font-weight: 800;
}

.detail-section {
    margin-top: 2rem;
}

.detail-section h2 {
    font-size: 1.45rem;
}

.detail-section p {
    color: var(--color-gray-700);
    line-height: 1.9;
}

.related-panel {
    position: sticky;
    top: 5.5rem;
    align-self: start;
    padding: 1.25rem;
}

.related-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.mini-card {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
}

.mini-card img {
    width: 6rem;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 0.75rem;
}

.mini-card h3 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 0.35rem;
    color: var(--color-gray-900);
    font-size: 0.95rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.mini-card p {
    margin: 0;
    color: var(--color-gray-500);
    font-size: 0.82rem;
}

.site-footer {
    color: var(--color-gray-300);
    background: var(--color-gray-900);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 1fr 1fr;
    gap: 2rem;
    max-width: 80rem;
    margin: 0 auto;
    padding: 3rem 1rem;
}

.footer-brand p {
    max-width: 40rem;
    color: var(--color-gray-300);
    line-height: 1.8;
}

.footer-logo {
    color: #ffffff;
    -webkit-background-clip: initial;
    background-clip: initial;
    background: none;
}

.site-footer h2 {
    margin: 0 0 1rem;
    color: #ffffff;
    font-size: 1rem;
}

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

.site-footer li + li {
    margin-top: 0.6rem;
}

.site-footer a {
    color: var(--color-gray-300);
    transition: color 0.2s ease;
}

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

.footer-bottom {
    max-width: 80rem;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--color-gray-300);
    font-size: 0.9rem;
    text-align: center;
}

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

    .desktop-nav {
        gap: 1rem;
    }

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

    .related-panel,
    .ranking-side {
        position: static;
    }
}

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

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

    .hero-card {
        min-height: 460px;
        height: 62vh;
    }

    .hero-content {
        right: 1.2rem;
        bottom: 1.2rem;
        left: 1.2rem;
    }

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

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

    .search-input-wrap {
        grid-column: 1 / -1;
    }

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

@media (max-width: 560px) {
    .site-logo {
        font-size: 1.08rem;
    }

    .hero-section,
    .content-section,
    .page-main,
    .player-hero {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    .hero-card {
        min-height: 430px;
        height: 58vh;
    }

    .movie-grid,
    .category-grid,
    .rank-grid,
    .rank-list-page,
    .footer-grid,
    .side-grid {
        grid-template-columns: 1fr;
    }

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

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

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

    .rank-item {
        grid-template-columns: auto 3.4rem minmax(0, 1fr);
    }

    .rank-meta {
        display: none;
    }

    .detail-content {
        padding: 1.2rem;
    }

    .detail-wrap {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }
}
