:root {
    color-scheme: dark;
    --bg: #05070d;
    --bg-soft: #0b1020;
    --card: rgba(15, 23, 42, 0.84);
    --card-strong: rgba(17, 24, 39, 0.96);
    --border: rgba(255, 255, 255, 0.10);
    --text: #f8fafc;
    --muted: #a8b3c7;
    --accent: #ef4444;
    --accent-2: #f97316;
    --gold: #facc15;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    --radius: 26px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 6%, rgba(239, 68, 68, 0.18), transparent 30%),
        radial-gradient(circle at 80% 0%, rgba(249, 115, 22, 0.14), transparent 32%),
        linear-gradient(180deg, #05070d 0%, #090d18 48%, #05070d 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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;
    border-bottom: 1px solid var(--border);
    background: rgba(5, 7, 13, 0.76);
    backdrop-filter: blur(20px);
}

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

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

.logo-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 12px 34px rgba(239, 68, 68, 0.35);
}

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

.nav-link {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    transition: 0.22s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.10);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--text);
    border-radius: 99px;
}

.hero-carousel {
    position: relative;
    min-height: 720px;
    overflow: hidden;
    isolation: isolate;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.58fr);
    align-items: center;
    gap: 56px;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 84px 0 130px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px) scale(0.98);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.hero-slide.is-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.hero-bg {
    position: fixed;
    inset: 0;
    z-index: -3;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center;
    opacity: 0.24;
    filter: blur(18px) saturate(1.2);
    transform: scale(1.08);
}

.hero-shade {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(90deg, rgba(5, 7, 13, 0.96) 0%, rgba(5, 7, 13, 0.74) 48%, rgba(5, 7, 13, 0.90) 100%),
        radial-gradient(circle at 70% 45%, rgba(239, 68, 68, 0.20), transparent 36%);
}

.hero-content {
    max-width: 760px;
}

.eyebrow,
.section-heading span,
.page-hero span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--gold);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-content h1,
.hero-content h2,
.page-hero h1 {
    margin: 0;
    font-size: clamp(42px, 7vw, 88px);
    line-height: 0.95;
    letter-spacing: -0.06em;
    font-weight: 950;
}

.hero-content h3 {
    margin: 18px 0 0;
    font-size: clamp(28px, 4vw, 54px);
    line-height: 1.05;
    font-weight: 900;
}

.hero-content p,
.page-hero p,
.centered-heading p {
    margin: 18px 0 0;
    color: #d3d9e8;
    font-size: 18px;
    line-height: 1.8;
}

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

.hero-tags span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 11px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    font-size: 12px;
}

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

.primary-btn,
.ghost-btn,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 850;
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    box-shadow: 0 16px 36px rgba(239, 68, 68, 0.34);
}

.ghost-btn,
.text-link {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.primary-btn:hover,
.ghost-btn:hover,
.text-link:hover {
    transform: translateY(-2px);
}

.hero-poster {
    position: relative;
    justify-self: end;
    width: min(390px, 100%);
    border-radius: 34px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    box-shadow: var(--shadow);
}

.hero-poster::before {
    content: "";
    display: block;
    padding-top: 138%;
}

.hero-poster img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.hero-poster:hover img,
.movie-card:hover img,
.rail-card:hover img,
.rank-thumb:hover img {
    transform: scale(1.055);
}

.hero-controls {
    position: absolute;
    left: 50%;
    bottom: 52px;
    z-index: 4;
    width: min(1240px, calc(100% - 32px));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
}

.hero-controls button {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-radius: 999px;
}

.hero-controls > button {
    width: 46px;
    height: 46px;
    font-size: 28px;
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    opacity: 0.5;
}

.hero-dot.is-active {
    width: 34px;
    opacity: 1;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.section-shell,
.page-hero,
.detail-hero {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
}

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

.home-search {
    margin-top: -40px;
    padding: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(22px);
    box-shadow: var(--shadow);
}

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

.section-heading h2,
.story-card h2,
.detail-info h1 {
    margin: 0;
    font-size: clamp(26px, 3.6vw, 44px);
    line-height: 1.1;
    font-weight: 920;
    letter-spacing: -0.04em;
}

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

.centered-heading {
    display: block;
    text-align: center;
    max-width: 820px;
    margin: 0 auto 26px;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 180px 180px;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.06);
}

.search-field {
    position: relative;
}

.search-field span {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font-weight: 900;
    font-size: 13px;
}

.search-field input,
.filter-panel select {
    width: 100%;
    height: 50px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.24);
    color: var(--text);
    outline: none;
}

.search-field input {
    padding: 0 16px 0 64px;
}

.filter-panel select {
    padding: 0 14px;
}

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

.category-card,
.category-overview-card,
.story-card,
.detail-meta-box,
.rank-list-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.category-card {
    display: block;
    padding: 18px;
    transition: transform 0.24s ease, border-color 0.24s ease;
}

.category-card:hover,
.category-overview-card:hover,
.movie-card:hover,
.rail-card:hover,
.rank-list-item:hover {
    transform: translateY(-4px);
    border-color: rgba(249, 115, 22, 0.46);
}

.category-posters,
.category-cover-stack {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 16px;
}

.category-posters img,
.category-cover-stack img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
}

.category-card strong {
    display: block;
    font-size: 20px;
    margin-bottom: 8px;
}

.category-card span,
.category-overview-card p,
.movie-card p,
.rail-card small,
.rank-list-item p,
.story-card p,
.detail-one-line,
.site-footer p {
    color: var(--muted);
    line-height: 1.75;
}

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

.movie-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.78);
    transition: transform 0.24s ease, border-color 0.24s ease;
}

.movie-cover {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
}

.movie-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.play-chip,
.rank-badge {
    position: absolute;
    z-index: 2;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.play-chip {
    right: 10px;
    bottom: 10px;
    padding: 6px 10px;
    background: rgba(239, 68, 68, 0.92);
}

.rank-badge {
    left: 10px;
    top: 10px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--gold), var(--accent-2));
    color: #111827;
}

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

.movie-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    color: #fbbf24;
    font-size: 12px;
    font-weight: 800;
}

.movie-card h3 {
    margin: 8px 0 6px;
    font-size: 17px;
    line-height: 1.3;
    font-weight: 850;
}

.movie-card p {
    display: -webkit-box;
    min-height: 4.9em;
    margin: 0;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: 13px;
}

.movie-card-compact p {
    -webkit-line-clamp: 2;
    min-height: 3.5em;
}

.movie-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(190px, 220px);
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: thin;
}

.rail-card {
    min-height: 100%;
    display: block;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.06);
    transition: transform 0.24s ease, border-color 0.24s ease;
}

.rail-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 16px;
    transition: transform 0.45s ease;
}

.rail-card span {
    display: block;
    margin-top: 10px;
    font-weight: 850;
}

.rail-card small {
    display: block;
    margin-top: 4px;
}

.page-main {
    padding-top: 42px;
}

.page-hero {
    min-height: 340px;
    display: flex;
    align-items: center;
    padding: 54px;
    border: 1px solid var(--border);
    border-radius: 34px;
    background:
        linear-gradient(135deg, rgba(239, 68, 68, 0.24), rgba(15, 23, 42, 0.92)),
        radial-gradient(circle at 82% 22%, rgba(249, 115, 22, 0.32), transparent 36%);
    box-shadow: var(--shadow);
}

.page-hero > div {
    max-width: 820px;
}

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

.breadcrumb a {
    color: #fbbf24;
}

.category-overview-grid {
    display: grid;
    gap: 18px;
}

.category-overview-card {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    padding: 20px;
    transition: transform 0.24s ease, border-color 0.24s ease;
}

.category-overview-card h2 {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 900;
}

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

.category-link-list a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: #e5e7eb;
}

.category-link-list span {
    color: var(--gold);
}

.rank-list {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rank-list-item {
    display: grid;
    grid-template-columns: 64px 96px 1fr;
    gap: 18px;
    align-items: center;
    padding: 14px;
    transition: transform 0.24s ease, border-color 0.24s ease;
}

.rank-number {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    font-size: 20px;
    font-weight: 950;
}

.rank-thumb {
    width: 96px;
    height: 132px;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(255,255,255,0.06);
}

.rank-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.rank-list-item h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 900;
}

.detail-main {
    padding-top: 30px;
}

.detail-hero {
    padding: 22px 0 44px;
}

.detail-breadcrumb {
    margin-bottom: 24px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.34fr) minmax(320px, 0.86fr);
    gap: 34px;
    align-items: start;
}

.watch-panel,
.detail-info {
    border: 1px solid var(--border);
    border-radius: 30px;
    background: rgba(15, 23, 42, 0.82);
    box-shadow: var(--shadow);
}

.watch-panel {
    overflow: hidden;
}

.video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-frame video,
.player-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.video-frame video {
    z-index: 1;
    background: #000;
}

.player-cover {
    z-index: 2;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    color: white;
    background: rgba(0, 0, 0, 0.46);
    overflow: hidden;
    cursor: pointer;
}

.player-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.52;
}

.play-button-core {
    position: relative;
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 20px 50px rgba(239, 68, 68, 0.45);
    font-size: 34px;
    padding-left: 5px;
}

.play-button-text {
    position: absolute;
    left: 50%;
    bottom: 22%;
    transform: translateX(-50%);
    font-weight: 900;
    letter-spacing: 0.08em;
}

.player-is-active .player-cover {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.detail-info {
    padding: 28px;
}

.detail-one-line {
    margin: 18px 0 0;
    font-size: 16px;
}

.detail-meta-box {
    margin-top: 24px;
    padding: 18px;
    box-shadow: none;
}

.detail-meta-box dl {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px 16px;
    margin: 0;
}

.detail-meta-box dt {
    color: var(--gold);
    font-weight: 900;
}

.detail-meta-box dd {
    margin: 0;
    color: #e5e7eb;
}

.detail-content-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.story-card {
    padding: 26px;
}

.story-card p {
    margin: 16px 0 0;
    font-size: 16px;
}

.detail-switcher {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.detail-switcher a {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    color: #fbbf24;
    font-weight: 800;
}

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

.site-footer {
    margin-top: 40px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.26);
}

.footer-inner {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 38px 0;
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 28px;
}

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

.footer-links a {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #d7dfef;
}

[hidden] {
    display: none !important;
}

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

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

@media (max-width: 900px) {
    .menu-toggle {
        display: block;
    }

    .site-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 74px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        border: 1px solid var(--border);
        border-radius: 20px;
        background: rgba(5, 7, 13, 0.96);
    }

    .site-nav.is-open {
        display: flex;
    }

    .hero-carousel {
        min-height: 800px;
    }

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

    .hero-poster {
        justify-self: start;
        width: min(270px, 72vw);
    }

    .filter-panel,
    .detail-layout,
    .footer-inner,
    .detail-content-section,
    .detail-switcher,
    .category-overview-card {
        grid-template-columns: 1fr;
    }

    .category-link-list {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 560px) {
    .header-inner,
    .section-shell,
    .page-hero,
    .detail-hero,
    .footer-inner {
        width: min(100% - 22px, 1240px);
    }

    .hero-carousel {
        min-height: 770px;
    }

    .hero-content h1,
    .hero-content h2,
    .page-hero h1 {
        font-size: 40px;
    }

    .hero-content h3 {
        font-size: 30px;
    }

    .home-search,
    .page-hero,
    .detail-info,
    .story-card {
        padding: 22px;
        border-radius: 24px;
    }

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

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

    .rank-list-item {
        grid-template-columns: 48px 78px 1fr;
        gap: 10px;
    }

    .rank-number {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        font-size: 16px;
    }

    .rank-thumb {
        width: 78px;
        height: 108px;
    }

    .rank-list-item h2 {
        font-size: 18px;
    }
}
