:root {
    color-scheme: dark;
    --bg: #050608;
    --bg-soft: #0b1117;
    --panel: rgba(17, 24, 39, 0.78);
    --panel-strong: rgba(15, 23, 42, 0.96);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --orange: #f97316;
    --orange-soft: rgba(249, 115, 22, 0.18);
    --cyan: #06b6d4;
    --cyan-soft: rgba(6, 182, 212, 0.16);
    --radius: 24px;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(249, 115, 22, 0.18), transparent 34rem),
        radial-gradient(circle at top right, rgba(6, 182, 212, 0.16), transparent 32rem),
        linear-gradient(180deg, #050608 0%, #09111a 48%, #030406 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    content: "";
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 78%);
}

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

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

button,
input {
    font: inherit;
}

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

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 16px 0;
}

.logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.logo-mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--orange), var(--cyan));
    box-shadow: 0 12px 30px rgba(249, 115, 22, 0.28);
}

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

.main-nav a,
.mobile-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 14px;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.header-search {
    position: relative;
    margin-left: auto;
    width: min(320px, 30vw);
}

.header-search input,
.large-search input,
.filter-toolbar input {
    width: 100%;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    outline: none;
    background: rgba(15, 23, 42, 0.84);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.header-search input {
    padding: 11px 16px;
}

.header-search input:focus,
.large-search input:focus,
.filter-toolbar input:focus {
    border-color: rgba(6, 182, 212, 0.55);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.08);
}

.search-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    display: none;
    width: min(420px, 86vw);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(2, 6, 23, 0.98);
    box-shadow: var(--shadow);
}

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

.search-panel a {
    display: block;
    padding: 12px 16px;
    color: var(--muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.search-panel a:last-child {
    border-bottom: 0;
}

.search-panel strong {
    display: block;
    color: var(--text);
    font-size: 14px;
}

.search-panel span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
}

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.86);
}

.menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    border-radius: 999px;
    background: var(--text);
}

.mobile-nav {
    display: none;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.92);
}

.hero {
    position: relative;
    width: min(1320px, calc(100% - 32px));
    min-height: 680px;
    margin: 28px auto 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 34px;
    background: #020617;
    box-shadow: var(--shadow);
}

.hero-track,
.hero-slide,
.hero-backdrop {
    position: absolute;
    inset: 0;
}

.hero-slide {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    align-items: center;
    gap: 40px;
    padding: clamp(36px, 7vw, 86px);
    opacity: 0;
    visibility: hidden;
    transform: scale(1.02);
    transition: opacity 0.75s ease, transform 0.75s ease, visibility 0.75s ease;
}

.hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.hero-backdrop img,
.detail-backdrop img {
    height: 100%;
    object-fit: cover;
    filter: blur(28px) saturate(1.25);
    transform: scale(1.1);
    opacity: 0.32;
}

.hero-backdrop::after,
.detail-backdrop::after {
    position: absolute;
    inset: 0;
    content: "";
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.64), rgba(2, 6, 23, 0.96)),
        radial-gradient(circle at 24% 18%, rgba(249, 115, 22, 0.24), transparent 26rem),
        radial-gradient(circle at 72% 70%, rgba(6, 182, 212, 0.22), transparent 28rem);
}

.hero-content,
.detail-info {
    position: relative;
    z-index: 3;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--orange);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    max-width: 860px;
    font-size: clamp(34px, 6vw, 70px);
    line-height: 0.98;
    letter-spacing: -0.065em;
}

.hero h2 {
    margin: 18px 0 0;
    max-width: 760px;
    color: #e2e8f0;
    font-size: clamp(26px, 4vw, 48px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero-copy,
.page-hero p,
.detail-line,
.intro-copy p {
    max-width: 720px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.8;
}

.hero-tags,
.movie-tags,
.detail-tags,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tags span,
.movie-tags span,
.detail-tags a,
.detail-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: #dbeafe;
    background: rgba(255, 255, 255, 0.07);
    font-size: 12px;
}

.hero-actions,
.detail-info .primary-button {
    margin-top: 28px;
}

.primary-button,
.ghost-button,
.large-search button,
.rank-action,
.filter-buttons button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-button,
.large-search button,
.rank-action,
.filter-buttons button.is-active {
    color: #020617;
    background: linear-gradient(135deg, var(--orange), var(--cyan));
    box-shadow: 0 18px 38px rgba(6, 182, 212, 0.18);
}

.ghost-button,
.filter-buttons button {
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.07);
}

.primary-button:hover,
.ghost-button:hover,
.large-search button:hover,
.rank-action:hover,
.filter-buttons button:hover {
    transform: translateY(-2px);
}

.hero-poster {
    position: relative;
    z-index: 3;
    display: block;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 30px;
    background: rgba(15, 23, 42, 0.86);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
}

.hero-poster img {
    aspect-ratio: 3 / 4.2;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.hero-poster:hover img,
.movie-card:hover .movie-poster img,
.rank-item:hover img,
.detail-poster:hover img {
    transform: scale(1.05);
}

.hero-controls {
    position: absolute;
    right: 30px;
    bottom: 26px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 14px;
}

.hero-controls button {
    width: 42px;
    height: 42px;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.82);
}

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

.hero-dots button {
    width: 9px;
    height: 9px;
    min-height: 0;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
}

.hero-dots button.is-active {
    width: 28px;
    background: linear-gradient(90deg, var(--orange), var(--cyan));
}

.content-section,
.page-hero,
.detail-layout,
.footer-grid,
.footer-bottom {
    width: min(1240px, calc(100% - 32px));
    margin-right: auto;
    margin-left: auto;
}

.content-section {
    margin-top: 58px;
}

.page-hero {
    padding: 76px 0 18px;
}

.slim-hero h1 {
    max-width: 980px;
}

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

.section-heading h2,
.intro-copy h2,
.side-panel h2,
.story-card h2 {
    margin: 0;
    font-size: clamp(26px, 3.6vw, 42px);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.section-heading a {
    color: var(--orange);
    font-weight: 800;
}

.intro-panel,
.side-panel,
.story-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(17, 24, 39, 0.55));
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.intro-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
    align-items: center;
    gap: 28px;
    padding: 30px;
}

.large-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.large-search input,
.filter-toolbar input {
    padding: 14px 18px;
}

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

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 16px 46px rgba(0, 0, 0, 0.24);
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(249, 115, 22, 0.34);
    background: rgba(15, 23, 42, 0.92);
}

.movie-poster {
    position: relative;
    display: block;
    overflow: hidden;
    background: #111827;
}

.movie-poster img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.movie-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 4px 9px;
    border-radius: 999px;
    color: #020617;
    background: linear-gradient(135deg, var(--orange), var(--cyan));
    font-size: 12px;
    font-weight: 900;
}

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

.movie-title {
    display: -webkit-box;
    overflow: hidden;
    min-height: 50px;
    color: var(--text);
    font-size: 17px;
    font-weight: 850;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.movie-meta,
.movie-desc {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.movie-meta {
    margin: 8px 0 4px;
}

.movie-desc {
    display: -webkit-box;
    overflow: hidden;
    min-height: 64px;
    margin: 0 0 12px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.movie-tags span {
    color: #fed7aa;
    background: var(--orange-soft);
}

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr);
    gap: 28px;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 58px 78px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.74);
    transition: transform 0.2s ease, background 0.2s ease;
}

.rank-item:hover {
    transform: translateX(4px);
    background: rgba(15, 23, 42, 0.96);
}

.rank-number {
    color: transparent;
    background: linear-gradient(135deg, var(--orange), var(--cyan));
    background-clip: text;
    font-size: 26px;
    font-weight: 950;
}

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

.rank-cover img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.rank-title {
    display: block;
    color: var(--text);
    font-weight: 850;
}

.rank-body p,
.rank-body span {
    display: block;
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.rank-body p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.side-panel {
    position: sticky;
    top: 96px;
    align-self: start;
    padding: 26px;
}

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

.category-grid.small {
    grid-template-columns: 1fr;
    margin-top: 22px;
}

.category-card {
    display: grid;
    min-height: 148px;
    align-content: space-between;
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(249, 115, 22, 0.12), transparent 45%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.88), rgba(8, 13, 23, 0.82));
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: rgba(6, 182, 212, 0.34);
}

.category-card span,
.category-card em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.category-card strong {
    font-size: 22px;
    letter-spacing: -0.03em;
}

.filter-toolbar {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.72);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-buttons button {
    min-height: 38px;
    padding: 0 15px;
    font-size: 13px;
}

[data-hidden="true"] {
    display: none !important;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.detail-backdrop {
    position: absolute;
    inset: 0;
}

.detail-layout {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(220px, 330px) minmax(0, 1fr);
    align-items: center;
    gap: clamp(28px, 6vw, 70px);
    min-height: 620px;
    padding: 68px 0;
}

.detail-poster {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 30px;
    box-shadow: var(--shadow);
}

.detail-poster img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.detail-info h1 {
    margin-bottom: 18px;
}

.detail-meta,
.detail-tags {
    margin-top: 18px;
}

.player-section {
    margin-top: 38px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: #000;
    box-shadow: var(--shadow);
}

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

.play-layer {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 12px;
    color: var(--text);
    border: 0;
    background:
        radial-gradient(circle at center, rgba(249, 115, 22, 0.16), transparent 24rem),
        rgba(0, 0, 0, 0.35);
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.play-layer.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.play-icon {
    display: grid;
    width: 76px;
    height: 76px;
    place-items: center;
    border-radius: 50%;
    color: #020617;
    background: linear-gradient(135deg, var(--orange), var(--cyan));
    box-shadow: 0 24px 60px rgba(6, 182, 212, 0.24);
}

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

.story-card {
    padding: 26px;
}

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

.story-card.meta-card {
    grid-column: 1 / -1;
}

.meta-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 20px 0 0;
}

.meta-card div {
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.meta-card dt {
    color: var(--muted);
    font-size: 12px;
}

.meta-card dd {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 5px 0 0;
    color: var(--text);
}

.meta-card dd a {
    color: var(--cyan);
}

.related-grid .movie-card-compact .movie-desc {
    display: none;
}

.site-footer {
    margin-top: 72px;
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.7);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.7fr 0.7fr;
    gap: 32px;
    padding: 42px 0;
}

.footer-grid p,
.footer-grid a,
.footer-bottom {
    color: var(--muted);
}

.footer-grid h2 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 16px;
}

.footer-grid a:not(.footer-logo) {
    display: block;
    margin-top: 8px;
}

.footer-grid a:hover {
    color: var(--orange);
}

.footer-bottom {
    padding: 18px 0 34px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 13px;
}

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

    .menu-button {
        display: block;
    }

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

    .header-search {
        width: min(360px, 44vw);
    }

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

    .hero-poster {
        display: none;
    }

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

    .split-section,
    .intro-panel,
    .detail-content {
        grid-template-columns: 1fr;
    }

    .side-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .header-inner {
        gap: 12px;
    }

    .logo span:last-child {
        display: none;
    }

    .header-search {
        width: 100%;
    }

    .mobile-nav.is-open {
        grid-template-columns: 1fr 1fr;
    }

    .hero {
        min-height: 620px;
        border-radius: 24px;
    }

    .hero-slide {
        padding: 32px 24px 96px;
    }

    .hero-controls {
        left: 22px;
        right: auto;
    }

    .large-search {
        grid-template-columns: 1fr;
    }

    .movie-grid,
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

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

    .rank-action {
        grid-column: 2 / -1;
        justify-self: start;
    }

    .detail-layout {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .detail-poster {
        width: min(280px, 76vw);
    }

    .meta-card dl,
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

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

    .hero h1,
    .page-hero h1,
    .detail-info h1 {
        font-size: 34px;
    }

    .content-section,
    .page-hero,
    .detail-layout,
    .footer-grid,
    .footer-bottom,
    .hero {
        width: min(100% - 22px, 1240px);
    }
}
