:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: #0f172a;
    --card: rgba(30, 41, 59, 0.72);
    --card-hover: rgba(51, 65, 85, 0.84);
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #cbd5e1;
    --soft: #94a3b8;
    --accent: #f59e0b;
    --accent-deep: #d97706;
    --radius: 20px;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 6%, rgba(245, 158, 11, 0.15), transparent 32rem),
        radial-gradient(circle at 82% 12%, rgba(59, 130, 246, 0.12), transparent 36rem),
        linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 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: 80;
    background: rgba(15, 23, 42, 0.92);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
}

.navbar {
    width: min(1180px, calc(100% - 32px));
    height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: max-content;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    color: white;
    background: linear-gradient(135deg, var(--accent), #fb7185);
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.34);
}

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

.nav-links a,
.mobile-panel a {
    color: var(--muted);
    font-weight: 600;
    transition: color 0.22s ease, transform 0.22s ease;
}

.nav-links a:hover,
.mobile-panel a:hover {
    color: white;
    transform: translateY(-1px);
}

.header-search {
    position: relative;
    width: 260px;
}

.header-search input,
.library-search,
.filter-select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(30, 41, 59, 0.86);
    color: var(--text);
    outline: none;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.header-search input {
    height: 42px;
    padding: 0 46px 0 16px;
}

.header-search input:focus,
.library-search:focus,
.filter-select:focus {
    border-color: rgba(245, 158, 11, 0.78);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.13);
    background: rgba(15, 23, 42, 0.96);
}

.header-search button {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    color: #f8fafc;
    background: rgba(245, 158, 11, 0.88);
    cursor: pointer;
}

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    margin-left: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: white;
    background: rgba(30, 41, 59, 0.8);
    cursor: pointer;
}

.mobile-panel {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 18px;
}

.mobile-panel.is-open {
    display: grid;
    gap: 14px;
}

.page-main {
    min-height: 70vh;
}

.hero {
    position: relative;
    height: 600px;
    overflow: hidden;
    background: #020617;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.9s ease;
}

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

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.03);
}

.hero-slide.is-active .hero-image {
    animation: heroZoom 8s ease forwards;
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.12)),
        linear-gradient(0deg, rgba(2, 6, 23, 0.86), transparent 46%, rgba(2, 6, 23, 0.25));
}

.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
}

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

.hero-copy {
    width: min(680px, 100%);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: 999px;
    color: white;
    background: rgba(245, 158, 11, 0.95);
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 12px 30px rgba(245, 158, 11, 0.24);
}

.hero h1,
.hero h2 {
    margin: 18px 0 16px;
    font-size: clamp(42px, 8vw, 74px);
    line-height: 1.03;
    letter-spacing: -0.05em;
    font-weight: 900;
}

.hero-desc {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
    color: #e2e8f0;
}

.hero-meta span,
.tag,
.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.14);
    background: rgba(15, 23, 42, 0.55);
    color: #e2e8f0;
    backdrop-filter: blur(10px);
}

.hero-meta span {
    padding: 8px 12px;
}

.hero-actions,
.section-actions,
.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 14px 34px rgba(245, 158, 11, 0.26);
}

.btn-primary:hover {
    background: var(--accent-deep);
    transform: translateY(-2px) scale(1.01);
}

.btn-ghost {
    border-color: rgba(226, 232, 240, 0.18);
    color: white;
    background: rgba(15, 23, 42, 0.58);
}

.btn-ghost:hover {
    border-color: rgba(245, 158, 11, 0.58);
    background: rgba(30, 41, 59, 0.88);
    transform: translateY(-2px);
}

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

.hero-dot {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.52);
    cursor: pointer;
    transition: width 0.22s ease, background 0.22s ease;
}

.hero-dot.is-active {
    width: 36px;
    background: var(--accent);
}

.content-wrap {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 54px 0;
}

.section-block {
    margin-bottom: 72px;
}

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

.section-title {
    margin: 0;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.section-subtitle {
    margin: 10px 0 0;
    max-width: 760px;
    color: var(--soft);
    line-height: 1.8;
}

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

.movie-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: rgba(245, 158, 11, 0.35);
    background: var(--card-hover);
    box-shadow: var(--shadow);
}

.poster-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #020617;
}

.poster-wrap.tall {
    aspect-ratio: 2 / 3;
}

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

.movie-card:hover .poster-wrap img,
.category-card:hover .poster-wrap img {
    transform: scale(1.09);
    filter: saturate(1.08) contrast(1.06);
}

.play-float {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: white;
    background: rgba(0, 0, 0, 0.52);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.movie-card:hover .play-float {
    opacity: 1;
}

.play-float span {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.94);
    box-shadow: 0 12px 35px rgba(245, 158, 11, 0.28);
}

.corner-label {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    color: white;
    font-size: 12px;
    font-weight: 800;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
}

.card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    margin: 0 0 10px;
    color: white;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 800;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-card:hover .card-title {
    color: #fbbf24;
}

.card-desc {
    margin: 0 0 15px;
    color: var(--soft);
    font-size: 14px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    color: var(--soft);
    font-size: 13px;
}

.meta-pill,
.tag {
    padding: 5px 9px;
    font-size: 12px;
}

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

.category-card {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    border: 1px solid rgba(245, 158, 11, 0.18);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.74));
    box-shadow: 0 16px 55px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(245, 158, 11, 0.48);
}

.category-card-content {
    position: relative;
    z-index: 2;
    padding: 26px;
}

.category-card h3 {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 900;
}

.category-card p {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.7;
}

.category-bg-row {
    position: absolute;
    right: 16px;
    bottom: -22px;
    display: flex;
    gap: 10px;
    opacity: 0.22;
    transform: rotate(-5deg);
}

.category-bg-row img {
    width: 86px;
    height: 126px;
    border-radius: 14px;
    object-fit: cover;
}

.horizontal-rail {
    overflow-x: auto;
    padding: 4px 0 18px;
    scrollbar-width: thin;
}

.horizontal-inner {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 292px;
    gap: 22px;
}

.feature-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
}

.rank-panel,
.glass-panel {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.78));
    box-shadow: var(--shadow);
}

.rank-panel {
    padding: 24px;
}

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

.rank-item a {
    display: grid;
    grid-template-columns: 46px 1fr 84px;
    gap: 13px;
    align-items: center;
    padding: 12px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.46);
    transition: background 0.2s ease, transform 0.2s ease;
}

.rank-item a:hover {
    background: rgba(51, 65, 85, 0.72);
    transform: translateX(3px);
}

.rank-no {
    color: var(--accent);
    font-size: 25px;
    font-weight: 900;
}

.rank-title {
    margin: 0;
    font-weight: 800;
    color: white;
    line-height: 1.35;
}

.rank-info {
    margin-top: 5px;
    color: var(--soft);
    font-size: 12px;
}

.rank-thumb {
    width: 84px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
}

.filter-bar {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 14px;
    margin: 28px 0;
}

.library-search,
.filter-select {
    min-height: 46px;
    padding: 0 15px;
}

.empty-state {
    display: none;
    padding: 32px;
    border-radius: 18px;
    text-align: center;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.72);
}

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

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

.breadcrumb a {
    color: #fbbf24;
}

.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

.player-box {
    overflow: hidden;
    border: 1px solid rgba(245, 158, 11, 0.18);
    border-radius: 24px;
    background: #000;
    box-shadow: var(--shadow);
}

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

.movie-video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

.player-layer {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.18));
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.player-start {
    width: 88px;
    height: 88px;
    border: 0;
    border-radius: 999px;
    color: white;
    background: rgba(245, 158, 11, 0.96);
    box-shadow: 0 18px 48px rgba(245, 158, 11, 0.32);
    font-size: 30px;
    cursor: pointer;
    transition: transform 0.22s ease, background 0.22s ease;
}

.player-start:hover {
    transform: scale(1.07);
    background: #d97706;
}

.player-error {
    display: none;
    padding: 16px 18px;
    color: #fecaca;
    background: rgba(127, 29, 29, 0.45);
}

.player-error.is-visible {
    display: block;
}

.detail-card {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.detail-title {
    margin: 0 0 14px;
    font-size: clamp(30px, 5vw, 52px);
    line-height: 1.12;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 22px;
}

.detail-copy {
    color: #dbe4ef;
    line-height: 1.9;
    font-size: 16px;
}

.detail-copy h2 {
    margin: 30px 0 12px;
    color: white;
    font-size: 24px;
}

.side-poster {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

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

.side-poster-body {
    padding: 20px;
}

.side-poster-body h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

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

.site-footer {
    margin-top: 64px;
    border-top: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.9);
}

.footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 38px 0;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 28px;
    color: var(--soft);
}

.footer-inner h3 {
    margin: 0 0 12px;
    color: white;
    font-size: 18px;
}

.footer-inner p,
.footer-inner a {
    color: var(--soft);
    line-height: 1.8;
}

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

.footer-bottom {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 28px;
    border-top: 1px solid var(--line);
    color: #64748b;
    text-align: center;
    font-size: 13px;
}

.pagination-links {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 22px;
}

@keyframes heroZoom {
    from {
        transform: scale(1.03);
    }

    to {
        transform: scale(1.1);
    }
}

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

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

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

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

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

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

@media (max-width: 760px) {
    .navbar {
        height: 62px;
    }

    .brand {
        font-size: 18px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }

    .hero {
        height: 620px;
    }

    .hero-content {
        align-items: end;
        padding-bottom: 82px;
    }

    .hero-meta {
        gap: 8px;
    }

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

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

    .section-head,
    .footer-inner {
        grid-template-columns: 1fr;
        display: grid;
        align-items: start;
    }

    .horizontal-inner {
        grid-auto-columns: 250px;
    }

    .card-body {
        padding: 14px;
    }

    .card-title {
        font-size: 16px;
    }

    .rank-item a {
        grid-template-columns: 42px 1fr;
    }

    .rank-thumb {
        display: none;
    }

    .pagination-links {
        flex-direction: column;
    }
}

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

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

    .content-wrap {
        padding: 38px 0;
    }
}
