* {
    box-sizing: border-box;
}

:root {
    --blue: #2563eb;
    --cyan: #06b6d4;
    --dark: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --soft: #f8fafc;
    --white: #ffffff;
    --radius: 18px;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--dark);
    background: var(--soft);
    line-height: 1.65;
}

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

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

button,
input,
select {
    font: inherit;
}

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

.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(14px);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 70px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--blue);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: #fff;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.24);
}

.brand-text {
    white-space: nowrap;
    font-size: 20px;
}

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

.nav-link {
    padding: 9px 13px;
    border-radius: 999px;
    color: #334155;
    font-weight: 600;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--blue);
    background: #eff6ff;
}

.header-search,
.mobile-search,
.search-page-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search input,
.mobile-search input,
.search-page-form input,
.filter-bar input,
.filter-bar select {
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 16px;
    outline: none;
    background: #fff;
    min-width: 0;
}

.header-search input:focus,
.mobile-search input:focus,
.search-page-form input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.header-search button,
.mobile-search button,
.search-page-form button,
.primary-btn,
.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.header-search button,
.mobile-search button,
.search-page-form button,
.primary-btn {
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.ghost-btn {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.primary-btn:hover,
.ghost-btn:hover,
.header-search button:hover,
.search-page-form button:hover {
    transform: translateY(-2px);
}

.menu-toggle {
    display: none;
    margin-left: auto;
    border: 0;
    background: #eff6ff;
    color: var(--blue);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
}

.mobile-panel {
    display: none;
    border-top: 1px solid var(--line);
    padding: 14px 16px 18px;
}

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

.mobile-panel nav {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.hero {
    position: relative;
    min-height: 620px;
    color: #fff;
    overflow: hidden;
    background: linear-gradient(120deg, #1d4ed8, #06b6d4);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 42px;
    align-items: center;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

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

.hero-backdrop {
    position: fixed;
    inset: 0;
    opacity: 0.18;
    background-size: cover;
    background-position: center;
    filter: blur(16px) saturate(1.2);
    transform: scale(1.06);
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.24), transparent 34%), linear-gradient(90deg, rgba(15, 23, 42, 0.42), rgba(15, 23, 42, 0.08));
    pointer-events: none;
}

.hero-content,
.hero-poster,
.hero-controls {
    position: relative;
    z-index: 2;
}

.eyebrow,
.section-head span,
.page-hero span,
.rank-intro span {
    display: inline-flex;
    margin-bottom: 12px;
    color: #bfdbfe;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

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

.hero p {
    max-width: 680px;
    margin: 0 0 22px;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
}

.hero-tags,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags span,
.tag-row span {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.tag-row span {
    color: var(--blue);
    background: #eff6ff;
}

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

.hero-poster {
    display: block;
    justify-self: end;
    width: min(370px, 100%);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.45);
    transform: rotate(2deg);
}

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

.hero-controls {
    position: absolute;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.hero-controls button {
    border: 0;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    width: 42px;
    height: 42px;
    border-radius: 999px;
    cursor: pointer;
}

.hero-dots {
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 10px !important;
    height: 10px !important;
    padding: 0;
    background: rgba(255, 255, 255, 0.4) !important;
}

.hero-dot.is-active {
    width: 28px !important;
    background: #fff !important;
}

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

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

.section-head h2,
.page-hero h1,
.rank-intro h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.12;
    letter-spacing: -0.03em;
}

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

.category-grid,
.movie-grid,
.category-list-grid {
    display: grid;
    gap: 22px;
}

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

.category-tile {
    position: relative;
    display: block;
    min-height: 150px;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--dark);
    box-shadow: var(--shadow);
}

.category-tile img {
    width: 100%;
    height: 100%;
    min-height: 150px;
    object-fit: cover;
    opacity: 0.72;
    transition: transform 0.25s ease;
}

.category-tile span {
    position: absolute;
    left: 18px;
    bottom: 16px;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
}

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

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

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

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

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

.poster {
    position: relative;
    display: block;
    overflow: hidden;
    background: #e2e8f0;
}

.poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.25s ease;
}

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

.play-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #fff;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.92);
    box-shadow: 0 12px 25px rgba(15, 23, 42, 0.26);
}

.movie-info {
    padding: 16px;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.movie-card h2 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.35;
}

.movie-card p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-card.compact h2 {
    font-size: 16px;
}

.movie-card.compact .movie-info {
    padding: 12px;
}

.movie-card.compact p,
.movie-card.compact .tag-row {
    display: none;
}

.rank-section {
    padding: 70px 0;
    color: #fff;
    background: linear-gradient(135deg, #f97316, #ef4444);
}

.rank-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.4fr;
    gap: 40px;
    align-items: start;
}

.rank-intro p {
    color: rgba(255, 255, 255, 0.86);
    margin-bottom: 24px;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 46px 58px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    transition: background 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.22);
}

.rank-num {
    font-size: 24px;
    font-weight: 900;
    color: #fff7ed;
}

.rank-item img {
    width: 58px;
    height: 76px;
    border-radius: 10px;
    object-fit: cover;
}

.rank-copy {
    min-width: 0;
}

.rank-copy strong,
.rank-copy em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-copy em {
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    font-style: normal;
}

.page-main,
.detail-main {
    padding: 34px 0 70px;
}

.page-hero {
    position: relative;
    padding: 54px;
    margin: 28px 0 36px;
    color: #fff;
    border-radius: 28px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: var(--shadow);
}

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

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

.category-card a {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 18px;
    align-items: center;
    overflow: hidden;
    padding: 14px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.category-card img {
    width: 160px;
    height: 120px;
    object-fit: cover;
    border-radius: 14px;
}

.category-card h2 {
    margin: 0 0 8px;
}

.category-card p {
    margin: 0;
    color: var(--muted);
}

.filter-bar {
    display: flex;
    gap: 12px;
    padding: 16px;
    margin-bottom: 24px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.filter-bar input {
    flex: 1;
}

.empty-state {
    display: none;
    padding: 28px;
    text-align: center;
    color: var(--muted);
    border-radius: var(--radius);
    background: #fff;
}

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

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

.breadcrumb a {
    color: var(--blue);
    font-weight: 800;
}

.detail-hero {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 34px;
    align-items: center;
    padding: 34px;
    border-radius: 28px;
    color: #fff;
    background: linear-gradient(135deg, #1e3a8a, #0891b2);
    box-shadow: var(--shadow);
}

.detail-copy h1 {
    margin: 0 0 16px;
    font-size: clamp(34px, 5vw, 60px);
    line-height: 1.08;
}

.detail-copy p {
    margin: 0 0 18px;
    max-width: 800px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
}

.detail-cover {
    width: 280px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 22px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.34);
}

.player-card,
.detail-content,
.search-panel,
.side-panel {
    margin-top: 28px;
    padding: 22px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.video-shell {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: #000;
    aspect-ratio: 16 / 9;
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: #fff;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.15), rgba(15, 23, 42, 0.74));
    cursor: pointer;
}

.player-overlay span {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    padding-left: 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    font-size: 34px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
}

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

.detail-content {
    display: grid;
    gap: 22px;
}

.detail-content h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

.detail-content p {
    margin: 0;
    color: #334155;
}

.info-table dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.info-table div {
    padding: 14px;
    border-radius: 14px;
    background: #f8fafc;
}

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

.info-table dd {
    margin: 4px 0 0;
    font-weight: 800;
}

.related-section {
    padding-bottom: 0;
}

.ranking-page-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 26px;
    padding-bottom: 70px;
}

.full-rank-list .rank-item {
    color: var(--dark);
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.full-rank-list .rank-num {
    color: #f97316;
}

.full-rank-list .rank-copy em {
    color: var(--muted);
}

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

.search-page-form {
    align-items: stretch;
}

.search-page-form input {
    flex: 1;
    height: 48px;
}

.search-results {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-top: 22px;
}

.search-empty {
    grid-column: 1 / -1;
    padding: 26px;
    text-align: center;
    color: var(--muted);
}

.site-footer {
    margin-top: 20px;
    color: #cbd5e1;
    background: #0f172a;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 32px;
    padding: 44px 0;
}

.footer-grid h2 {
    margin: 0 0 14px;
    color: #fff;
    font-size: 18px;
}

.footer-grid p {
    max-width: 430px;
}

.footer-links {
    display: grid;
    gap: 9px;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    padding: 18px;
    text-align: center;
    color: #94a3b8;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

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

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

    .ranking-page-grid {
        grid-template-columns: 1fr;
    }
}

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

    .menu-toggle {
        display: grid;
        place-items: center;
    }

    .hero {
        min-height: 720px;
    }

    .hero-slide {
        grid-template-columns: 1fr;
        gap: 24px;
        align-content: center;
    }

    .hero-poster {
        justify-self: start;
        width: 220px;
        transform: none;
    }

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

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

    .detail-cover {
        width: min(260px, 100%);
    }
}

@media (max-width: 560px) {
    .site-container {
        width: min(100% - 22px, 1180px);
    }

    .brand-text {
        font-size: 17px;
    }

    .hero {
        min-height: 760px;
    }

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

    .hero p,
    .detail-copy p {
        font-size: 16px;
    }

    .category-grid,
    .movie-grid,
    .compact-grid,
    .category-list-grid,
    .search-results {
        grid-template-columns: 1fr;
    }

    .category-card a {
        grid-template-columns: 1fr;
    }

    .category-card img {
        width: 100%;
        height: 190px;
    }

    .section-head,
    .filter-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .page-hero,
    .detail-hero {
        padding: 28px;
        border-radius: 22px;
    }

    .info-table dl {
        grid-template-columns: 1fr;
    }
}
