:root {
    color-scheme: light;
    --bg: #f8fafc;
    --paper: #ffffff;
    --ink: #111827;
    --muted: #64748b;
    --line: #e5e7eb;
    --soft: #f1f5f9;
    --red: #dc2626;
    --red-dark: #b91c1c;
    --rose: #e11d48;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 45%, #f1f5f9 100%);
    color: var(--ink);
    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;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    background: linear-gradient(90deg, rgba(248, 250, 252, 0.96), rgba(249, 250, 251, 0.96));
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(14px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--red), var(--rose));
    color: #ffffff;
    font-size: 18px;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.28);
    transition: transform 0.28s ease;
}

.brand:hover .brand-icon {
    transform: scale(1.08) rotate(-2deg);
}

.brand-text strong,
.footer-brand strong {
    display: block;
    color: #1f2937;
    font-size: 21px;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.brand-text small,
.footer-brand small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

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

.nav-link {
    position: relative;
    color: #374151;
    font-weight: 700;
    transition: color 0.2s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -9px;
    height: 3px;
    border-radius: 99px;
    background: var(--red);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--red-dark);
}

.nav-link:hover::after,
.nav-link.is-active::after {
    transform: scaleX(1);
}

.header-search,
.mobile-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 6px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.header-search input,
.mobile-search input {
    width: 210px;
    border: 0;
    outline: 0;
    padding: 8px 8px 8px 14px;
    background: transparent;
}

.header-search button,
.mobile-search button,
.btn {
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    padding: 9px 18px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.header-search button,
.mobile-search button,
.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--red), var(--rose));
    box-shadow: 0 12px 24px rgba(220, 38, 38, 0.2);
}

.header-search button:hover,
.mobile-search button:hover,
.btn-primary:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--red-dark), #be123c);
}

.btn-ghost {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
}

.btn-ghost:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.24);
}

.menu-toggle {
    display: none;
    border: 0;
    background: #ffffff;
    border-radius: 10px;
    padding: 9px 12px;
    color: #1f2937;
    box-shadow: var(--shadow-soft);
}

.mobile-panel {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 16px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

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

.mobile-search {
    margin-bottom: 12px;
}

.mobile-search input {
    flex: 1;
    width: auto;
}

.mobile-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.mobile-links a {
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
}

.mobile-links a:hover {
    background: #fef2f2;
    color: var(--red-dark);
}

.hero-carousel {
    position: relative;
    height: 600px;
    overflow: hidden;
    background: #111827;
}

.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-slide > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.52) 46%, rgba(0, 0, 0, 0.18));
}

.hero-content {
    position: absolute;
    left: 50%;
    bottom: 76px;
    transform: translateX(-50%);
    color: #ffffff;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fecaca;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}

.hero-content h1 {
    max-width: 760px;
    margin: 0 0 18px;
    font-size: clamp(34px, 6vw, 64px);
    line-height: 1.02;
    letter-spacing: -0.06em;
}

.hero-content p {
    max-width: 680px;
    margin: 0 0 18px;
    color: #e5e7eb;
    font-size: 19px;
    line-height: 1.75;
}

.hero-tags,
.tag-list,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.hero-tags span {
    color: #ffffff;
    background: rgba(220, 38, 38, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 800;
}

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

.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 38px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover {
    background: rgba(255, 255, 255, 0.34);
    transform: translateY(-50%) scale(1.05);
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.hero-dot.is-active {
    width: 34px;
    background: #ffffff;
}

.page-flow {
    padding-top: 48px;
    padding-bottom: 28px;
}

.page-top {
    padding-top: 34px;
}

.content-section {
    margin-bottom: 64px;
}

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

.section-heading h2 {
    margin: 0;
    color: #1f2937;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.section-heading p {
    margin: 8px 0 0;
    color: var(--muted);
}

.section-more,
.category-preview-head a,
.category-card span {
    color: var(--red-dark);
    font-weight: 900;
}

.scroll-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 330px);
    gap: 22px;
    overflow-x: auto;
    padding-bottom: 14px;
    scroll-snap-type: x mandatory;
}

.scroll-row .movie-card {
    scroll-snap-align: start;
}

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

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

.movie-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.86);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(220, 38, 38, 0.25);
    box-shadow: var(--shadow);
}

.poster-link {
    position: relative;
    display: block;
    height: 255px;
    overflow: hidden;
    background: #111827;
}

.movie-card-small .poster-link {
    height: 168px;
}

.movie-card-large .poster-link {
    height: 280px;
}

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

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

.poster-link::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.03));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.movie-card:hover .poster-link::after {
    opacity: 1;
}

.play-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%) scale(0.86);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--red-dark);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .play-badge {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

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

.movie-card-body h3 {
    margin: 0 0 10px;
    color: #1f2937;
    font-size: 18px;
    line-height: 1.35;
}

.movie-card-body h3 a:hover {
    color: var(--red-dark);
}

.movie-card-body p {
    min-height: 50px;
    margin: 0 0 14px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.65;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    color: #6b7280;
    font-size: 13px;
}

.movie-meta span {
    border-radius: 999px;
    background: #f8fafc;
    padding: 4px 9px;
}

.tag-list span {
    border-radius: 999px;
    background: #fef2f2;
    color: var(--red-dark);
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
}

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

.category-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.category-preview-head h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 21px;
    color: #374151;
}

.category-preview-head h3::before {
    content: "";
    width: 5px;
    height: 26px;
    border-radius: 999px;
    background: var(--red);
}

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
    gap: 30px;
    align-items: start;
}

.home-side-card,
.detail-card,
.side-poster-card,
.side-list-card,
.page-hero,
.category-card {
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.home-side-card {
    padding: 30px;
    background: linear-gradient(135deg, #dc2626, #e11d48);
    color: #ffffff;
}

.home-side-card h2 {
    margin: 0 0 16px;
    font-size: 28px;
    line-height: 1.15;
}

.home-side-card p {
    color: #fee2e2;
    line-height: 1.8;
}

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

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

.ranking-item {
    display: grid;
    grid-template-columns: auto 74px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    padding: 10px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ranking-item:hover {
    transform: translateX(4px);
    border-color: rgba(220, 38, 38, 0.28);
    box-shadow: var(--shadow-soft);
}

.ranking-item img {
    width: 74px;
    height: 92px;
    object-fit: cover;
    border-radius: 12px;
    background: #111827;
}

.ranking-item strong {
    display: block;
    color: #1f2937;
    line-height: 1.35;
}

.ranking-item small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.45;
}

.rank-num,
.rank-dot {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--red), var(--rose));
    font-weight: 900;
}

.rank-dot {
    font-size: 22px;
}

.page-hero {
    position: relative;
    overflow: hidden;
    padding: 42px;
    background: linear-gradient(135deg, #fff1f2, #ffffff 42%, #f8fafc);
}

.page-hero::after {
    content: "";
    position: absolute;
    right: -70px;
    top: -90px;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.12);
}

.page-hero span {
    display: inline-flex;
    border-radius: 999px;
    background: #fee2e2;
    color: var(--red-dark);
    padding: 7px 13px;
    font-weight: 900;
}

.page-hero h1 {
    position: relative;
    z-index: 1;
    margin: 16px 0 12px;
    color: #111827;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.1;
    letter-spacing: -0.05em;
}

.page-hero p {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0;
    color: #64748b;
    font-size: 17px;
    line-height: 1.8;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: #64748b;
    font-size: 14px;
}

.breadcrumb a:hover {
    color: var(--red-dark);
}

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

.category-card {
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.category-covers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 170px;
    background: #111827;
}

.category-covers img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card-body {
    padding: 24px;
}

.category-card h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

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

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 170px 170px;
    gap: 12px;
    margin-bottom: 24px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.filter-bar input,
.filter-bar select {
    width: 100%;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #f8fafc;
    color: #1f2937;
    padding: 12px 15px;
    outline: 0;
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 30px;
    align-items: start;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: #030712;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.movie-player {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #030712;
}

.player-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    cursor: pointer;
    background: #030712;
}

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

.player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-cover-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.2));
}

.player-button {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 86px;
    height: 86px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--red-dark);
    font-size: 34px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.detail-card {
    margin-top: 24px;
    padding: 30px;
}

.detail-card h1 {
    margin: 0 0 16px;
    color: #111827;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.14;
    letter-spacing: -0.04em;
}

.detail-card h2 {
    margin: 28px 0 12px;
    color: #1f2937;
    font-size: 24px;
}

.detail-card p {
    margin: 0;
    color: #475569;
    line-height: 1.9;
    font-size: 16px;
}

.detail-card .lead-text {
    color: #334155;
    font-size: 18px;
    font-weight: 700;
}

.detail-meta {
    margin: 0 0 16px;
}

.detail-meta span {
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    padding: 8px 13px;
    font-weight: 800;
}

.detail-tags {
    margin-bottom: 20px;
}

.detail-side {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 20px;
}

.side-poster-card,
.side-list-card {
    padding: 18px;
}

.side-poster-card img {
    width: 100%;
    height: 410px;
    object-fit: cover;
    border-radius: 16px;
    background: #111827;
}

.side-poster-card h2,
.side-list-card h2 {
    margin: 18px 0 10px;
    color: #111827;
    font-size: 22px;
}

.side-poster-card p {
    color: var(--muted);
    line-height: 1.7;
}

.side-poster-card .btn {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    margin-top: 12px;
}

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

.site-footer {
    margin-top: 56px;
    color: #d1d5db;
    background: linear-gradient(135deg, #111827, #1f2937);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 0.8fr;
    gap: 38px;
    padding: 48px 0;
}

.site-footer .brand-icon {
    box-shadow: none;
}

.site-footer strong {
    color: #ffffff;
}

.footer-about p {
    max-width: 520px;
    color: #9ca3af;
    line-height: 1.8;
}

.site-footer h3 {
    margin: 0 0 16px;
    color: #ffffff;
}

.site-footer ul {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer a {
    color: #cbd5e1;
}

.site-footer a:hover {
    color: #fecaca;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #9ca3af;
}

.is-hidden-by-filter {
    display: none !important;
}

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

    .menu-toggle {
        display: inline-flex;
    }

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

    .detail-layout,
    .split-section,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .detail-side {
        position: static;
    }

    .side-poster-card img {
        height: 360px;
    }
}

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

    .header-inner {
        min-height: 66px;
    }

    .brand-text strong {
        font-size: 18px;
    }

    .hero-carousel {
        height: 560px;
    }

    .hero-content {
        bottom: 72px;
    }

    .hero-content p {
        font-size: 16px;
    }

    .hero-arrow {
        top: auto;
        bottom: 22px;
        width: 42px;
        height: 42px;
        font-size: 30px;
    }

    .hero-prev {
        left: 18px;
    }

    .hero-next {
        right: 18px;
    }

    .hero-dots {
        bottom: 36px;
    }

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

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

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

    .poster-link {
        height: 210px;
    }

    .category-covers {
        height: 130px;
    }

    .page-hero,
    .detail-card {
        padding: 24px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .movie-grid,
    .movie-grid-compact,
    .category-preview-grid,
    .category-grid,
    .ranking-list-wide,
    .top-rank-grid {
        grid-template-columns: 1fr;
    }

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

    .ranking-item img {
        width: 64px;
        height: 82px;
    }

    .scroll-row {
        grid-auto-columns: minmax(245px, 82vw);
    }

    .poster-link,
    .movie-card-large .poster-link {
        height: 260px;
    }

    .side-poster-card img {
        height: 320px;
    }
}
