:root {
    color-scheme: dark;
    --bg: #050816;
    --bg-soft: #0b1224;
    --panel: rgba(15, 23, 42, 0.76);
    --panel-solid: #111827;
    --text: #f8fafc;
    --muted: #94a3b8;
    --line: rgba(148, 163, 184, 0.22);
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --violet: #8b5cf6;
    --rose: #f43f5e;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 10%, rgba(34, 211, 238, 0.18), transparent 32rem),
        radial-gradient(circle at 82% 2%, rgba(139, 92, 246, 0.17), transparent 30rem),
        linear-gradient(180deg, #020617 0%, #07111f 44%, #050816 100%);
}

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

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: rgba(3, 7, 18, 0.78);
    backdrop-filter: blur(18px);
}

.header-inner {
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 22px;
}

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

.logo-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, var(--cyan), var(--blue), var(--violet));
    box-shadow: 0 14px 36px rgba(34, 211, 238, 0.28);
}

.logo-text {
    font-size: 19px;
    white-space: nowrap;
}

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

.nav-link,
.mobile-link {
    color: #cbd5e1;
    padding: 10px 14px;
    border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
    color: white;
    background: rgba(34, 211, 238, 0.14);
}

.nav-search {
    position: relative;
    margin-left: auto;
    width: min(360px, 32vw);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
}

.nav-search input,
.hero-search input,
.page-filter input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

.nav-search input::placeholder,
.hero-search input::placeholder,
.page-filter input::placeholder {
    color: #64748b;
}

.nav-search button,
.hero-search button {
    border: 0;
    color: #02111d;
    cursor: pointer;
    font-weight: 800;
    border-radius: 999px;
    padding: 9px 16px;
    background: linear-gradient(135deg, var(--cyan), #60a5fa);
}

.search-results {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(430px, 92vw);
    display: none;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(3, 7, 18, 0.97);
    box-shadow: var(--shadow);
}

.search-results.wide {
    left: 0;
    right: auto;
    width: 100%;
}

.search-results.open {
    display: block;
}

.search-results a,
.search-empty {
    display: block;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
}

.search-results a:hover {
    background: rgba(34, 211, 238, 0.1);
}

.search-results strong {
    display: block;
    font-size: 15px;
}

.search-results span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.menu-button {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.7);
    cursor: pointer;
}

.menu-button span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    background: white;
    border-radius: 4px;
}

.mobile-menu {
    display: none;
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.88);
}

.mobile-menu.is-open {
    display: grid;
    gap: 8px;
}

.hero {
    position: relative;
    min-height: 78vh;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: none;
    background-size: cover;
    background-position: center;
}

.hero-slide.active {
    display: block;
    animation: fadeIn 0.6s ease both;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.76) 44%, rgba(2, 6, 23, 0.36)),
        linear-gradient(0deg, #050816, transparent 40%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1440px, calc(100% - 32px));
    min-height: 78vh;
    margin: 0 auto;
    padding: 76px 0 64px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    align-items: center;
    gap: 52px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--cyan);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.detail-content h1 {
    margin: 16px 0;
    font-size: clamp(36px, 6vw, 82px);
    line-height: 0.95;
    letter-spacing: -0.07em;
}

.hero p,
.page-hero p,
.lead {
    max-width: 760px;
    color: #cbd5e1;
    font-size: clamp(16px, 1.8vw, 22px);
    line-height: 1.8;
}

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

.hero-tags span,
.tag-row span,
.info-pills span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 11px;
    color: #dbeafe;
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.1);
    font-size: 12px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
}

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

.primary-button {
    color: #00111a;
    background: linear-gradient(135deg, var(--cyan), #60a5fa);
    box-shadow: 0 18px 44px rgba(34, 211, 238, 0.24);
}

.primary-button:hover,
.ghost-button:hover,
.section-more:hover,
.movie-card:hover,
.category-tile:hover {
    transform: translateY(-3px);
}

.ghost-button,
.section-more {
    color: white;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.08);
}

.full {
    width: 100%;
}

.hero-poster {
    position: relative;
    aspect-ratio: 2 / 3;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 34px;
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero-poster::before,
.poster-bg::before,
.detail-cover::before,
.category-tile::before,
.rank-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(139, 92, 246, 0.18));
}

.hero-poster span,
.detail-cover span {
    position: absolute;
    right: 16px;
    top: 16px;
    z-index: 2;
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    color: #00111a;
    font-weight: 950;
    background: linear-gradient(135deg, #fef08a, #f59e0b);
}

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

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

.hero-dot.active {
    background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.search-panel,
.content-section,
.home-layout,
.page-main,
.detail-main,
.site-footer {
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
}

.search-panel {
    position: relative;
    z-index: 8;
    margin-top: -34px;
}

.hero-search,
.page-filter {
    position: relative;
    display: flex;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.92);
    box-shadow: var(--shadow);
}

.hero-search input,
.page-filter input {
    min-height: 52px;
    padding: 0 18px;
}

.content-section {
    padding: 58px 0 10px;
}

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

.section-heading span,
.rank-title span {
    color: var(--cyan);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.section-heading h2,
.rank-title h2 {
    margin: 6px 0 0;
    font-size: clamp(26px, 3vw, 42px);
    letter-spacing: -0.05em;
}

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

.compact-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.movie-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
    border-color: rgba(34, 211, 238, 0.55);
    box-shadow: 0 24px 60px rgba(34, 211, 238, 0.12);
}

.poster-bg {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    background:
        linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(139, 92, 246, 0.18)),
        #111827;
    background-size: cover;
    background-position: center;
}

.card-body {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.card-meta strong {
    color: #facc15;
    font-size: 14px;
}

.card-meta em {
    font-style: normal;
}

.card-title {
    display: -webkit-box;
    min-height: 44px;
    overflow: hidden;
    color: white;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-desc {
    display: -webkit-box;
    min-height: 58px;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.category-grid.large {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.category-tile {
    position: relative;
    min-height: 180px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 30px;
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.tile-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.88));
}

.tile-content {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 22px;
    z-index: 2;
    display: grid;
    gap: 8px;
}

.tile-content strong {
    font-size: 26px;
    font-weight: 950;
}

.tile-content em {
    color: #cbd5e1;
    font-style: normal;
}

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 32px;
    align-items: start;
}

.rank-aside {
    position: sticky;
    top: 96px;
    padding-top: 58px;
}

.rank-card,
.rank-section,
.detail-content,
.player-shell,
.detail-cover,
.page-hero {
    border: 1px solid var(--line);
    border-radius: 32px;
    background: rgba(15, 23, 42, 0.78);
    box-shadow: var(--shadow);
}

.rank-card {
    padding: 24px;
}

.rank-links {
    display: grid;
    gap: 10px;
    margin: 22px 0;
}

.rank-links a {
    display: grid;
    grid-template-columns: 36px 1fr 48px;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 8px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
}

.rank-links strong,
.rank-row strong {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 12px;
    color: #02111d;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.rank-links span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rank-links em {
    color: #facc15;
    font-style: normal;
    font-weight: 900;
}

.page-main {
    padding-bottom: 60px;
}

.page-hero {
    position: relative;
    overflow: hidden;
    margin-top: 38px;
    padding: clamp(34px, 5vw, 70px);
    background-size: cover;
    background-position: center;
}

.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.72)),
        radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.18), transparent 28rem);
}

.page-hero > * {
    position: relative;
    z-index: 2;
}

.compact-hero h1 {
    max-width: 980px;
    font-size: clamp(36px, 4vw, 60px);
}

.ranking-wrap {
    display: grid;
    gap: 30px;
}

.rank-section {
    padding: 24px;
}

.rank-table {
    display: grid;
    gap: 10px;
}

.rank-row {
    display: grid;
    grid-template-columns: 42px 64px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 14px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
}

.rank-row:hover {
    border-color: rgba(34, 211, 238, 0.45);
    background: rgba(34, 211, 238, 0.08);
}

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

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

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

.rank-info em {
    color: white;
    font-style: normal;
    font-weight: 850;
}

.rank-info small {
    margin-top: 4px;
    color: var(--muted);
}

.rank-row b {
    color: #facc15;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 28px 0 18px;
    color: var(--muted);
}

.breadcrumb a {
    color: #bae6fd;
}

.breadcrumb em {
    color: #e2e8f0;
    font-style: normal;
}

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

.player-section {
    display: grid;
    gap: 18px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    background: #020617;
    aspect-ratio: 16 / 9;
}

.movie-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #020617;
    outline: 0;
}

.player-cover {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    gap: 10px;
    padding: 30px;
    border: 0;
    color: white;
    cursor: pointer;
    text-align: center;
    background:
        radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.22), transparent 20rem),
        linear-gradient(180deg, rgba(2, 6, 23, 0.28), rgba(2, 6, 23, 0.9));
}

.player-cover.hidden {
    display: none;
}

.play-icon {
    display: inline-grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    color: #00111a;
    background: linear-gradient(135deg, var(--cyan), #60a5fa);
    box-shadow: 0 20px 60px rgba(34, 211, 238, 0.34);
}

.player-cover strong {
    max-width: 800px;
    font-size: clamp(24px, 4vw, 48px);
}

.player-cover em {
    max-width: 720px;
    color: #cbd5e1;
    font-style: normal;
    line-height: 1.7;
}

.play-trigger {
    justify-self: start;
}

.detail-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 28px;
    margin-top: 38px;
}

.detail-cover {
    position: sticky;
    top: 96px;
    min-height: 480px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.detail-content {
    padding: clamp(24px, 4vw, 44px);
}

.detail-content h1 {
    font-size: clamp(34px, 5vw, 62px);
}

.detail-content h2 {
    margin: 34px 0 14px;
    font-size: 26px;
}

.detail-content p {
    color: #cbd5e1;
    font-size: 16px;
    line-height: 1.9;
}

.info-pills {
    margin: 20px 0;
}

.detail-tags {
    margin-top: 10px;
}

.related-section {
    width: 100%;
}

.site-footer {
    margin-top: 70px;
    padding: 34px 0 26px;
    border-top: 1px solid var(--line);
}

.footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 640px);
    gap: 32px;
}

.footer-inner p {
    max-width: 620px;
    color: var(--muted);
    line-height: 1.8;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.footer-links a {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #cbd5e1;
}

.footer-bottom {
    margin-top: 28px;
    color: #64748b;
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(1.02);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

    .rank-aside,
    .detail-cover {
        position: static;
    }

    .detail-cover {
        min-height: 420px;
    }
}

@media (max-width: 820px) {
    .header-inner {
        min-height: 68px;
    }

    .main-nav {
        display: none;
    }

    .menu-button {
        display: block;
        margin-left: auto;
    }

    .logo-text {
        max-width: 210px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 28px;
        padding-top: 48px;
    }

    .hero-poster {
        max-width: 260px;
    }

    .hero-actions,
    .section-heading,
    .footer-inner {
        align-items: stretch;
        flex-direction: column;
        grid-template-columns: 1fr;
    }

    .footer-links {
        justify-content: flex-start;
    }

    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
        gap: 14px;
    }

    .card-body {
        padding: 12px;
    }

    .rank-row {
        grid-template-columns: 34px 52px minmax(0, 1fr) 38px;
        gap: 10px;
    }
}

@media (max-width: 560px) {
    .search-panel,
    .content-section,
    .home-layout,
    .page-main,
    .detail-main,
    .site-footer,
    .header-inner,
    .mobile-menu {
        width: min(100% - 22px, 1440px);
    }

    .logo-mark {
        width: 38px;
        height: 38px;
    }

    .logo-text {
        font-size: 16px;
        max-width: 172px;
    }

    .hero,
    .hero-content {
        min-height: 720px;
    }

    .hero-search {
        display: grid;
        border-radius: 22px;
    }

    .hero-search button {
        min-height: 46px;
    }

    .page-hero,
    .rank-card,
    .rank-section,
    .detail-content {
        border-radius: 24px;
    }

    .player-shell {
        border-radius: 22px;
    }

    .player-cover em {
        display: none;
    }
}
