* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: #111827;
    background: #f8fafc;
    line-height: 1.6;
}

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: 50;
    color: #ffffff;
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 48%, #0f172a 100%);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.28);
}

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

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.brand-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    box-shadow: 0 10px 25px rgba(96, 165, 250, 0.35);
    font-size: 14px;
}

.brand-icon.small {
    width: 28px;
    height: 28px;
}

.brand-text {
    font-size: 24px;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

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

.nav-link {
    color: #cbd5e1;
    font-weight: 650;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff;
    transform: translateY(-1px);
}

.site-search {
    position: relative;
    display: flex;
    align-items: center;
}

.site-search input {
    width: 260px;
    padding: 10px 16px 10px 40px;
    color: #ffffff;
    background: #334155;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    outline: none;
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

.site-search input::placeholder {
    color: #94a3b8;
}

.site-search input:focus {
    background: #1e293b;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.35);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.mobile-toggle {
    display: none;
    color: #ffffff;
    background: transparent;
    border: 0;
    border-radius: 12px;
    padding: 8px 10px;
    cursor: pointer;
}

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

.mobile-nav {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.mobile-nav .nav-link {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(51, 65, 85, 0.55);
}

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

.soft-bg {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.page-content {
    padding: 34px 0 56px;
}

.hero-slider {
    position: relative;
    min-height: 520px;
    overflow: hidden;
    background: #0f172a;
}

.hero-viewport {
    position: relative;
    min-height: 520px;
}

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

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

.hero-slide img {
    width: 100%;
    height: 100%;
    min-height: 520px;
    object-fit: cover;
    transform: scale(1.03);
    transition: transform 6s ease;
}

.hero-slide.active img {
    transform: scale(1.12);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(15, 23, 42, 0.76) 44%, rgba(15, 23, 42, 0.22) 100%), linear-gradient(0deg, rgba(2, 6, 23, 0.55), transparent 45%);
}

.hero-content {
    position: absolute;
    left: max(32px, calc((100vw - 1180px) / 2));
    bottom: 74px;
    width: min(680px, calc(100% - 64px));
    color: #ffffff;
}

.hero-content h1 {
    margin: 18px 0 14px;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.hero-content p {
    max-width: 650px;
    margin: 0 0 28px;
    color: #dbeafe;
    font-size: clamp(16px, 2vw, 20px);
}

.movie-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 700;
}

.pill.blue {
    color: #ffffff;
    background: #2563eb;
}

.pill.dark {
    color: #ffffff;
    background: rgba(15, 23, 42, 0.76);
}

.pill.glass {
    color: #e0f2fe;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(12px);
}

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

.primary-button,
.ghost-button,
.watch-link,
.section-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 999px;
    padding: 0 20px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button,
.watch-link {
    color: #ffffff;
    background: #2563eb;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.32);
}

.ghost-button {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px);
}

.primary-button:hover,
.ghost-button:hover,
.watch-link:hover,
.section-action:hover {
    transform: translateY(-2px);
}

.primary-button.full {
    width: 100%;
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.42);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transform: translateY(-50%);
    opacity: 0.84;
    transition: background 0.2s ease, opacity 0.2s ease;
    font-size: 32px;
}

.hero-arrow:hover {
    background: rgba(0, 0, 0, 0.68);
    opacity: 1;
}

.hero-arrow.prev {
    left: 24px;
}

.hero-arrow.next {
    right: 24px;
}

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

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

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

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

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

.section-heading.compact {
    align-items: center;
}

.section-heading h2 {
    margin: 0 0 6px;
    color: #111827;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.2;
    font-weight: 900;
}

.section-heading p {
    margin: 0;
    color: #64748b;
}

.section-action {
    min-height: 38px;
    color: #1d4ed8;
    background: #dbeafe;
}

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

.movie-card {
    display: block;
    overflow: hidden;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.16);
}

.poster-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    background: linear-gradient(135deg, #1e293b, #334155);
}

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

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

.corner-badge {
    position: absolute;
    top: 10px;
    z-index: 2;
    max-width: calc(100% - 20px);
    overflow: hidden;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.66);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.corner-badge.left {
    left: 10px;
}

.corner-badge.right {
    right: 10px;
}

.rank-mark {
    position: absolute;
    left: 10px;
    bottom: 10px;
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    color: #ffffff;
    background: linear-gradient(135deg, #f97316, #ef4444);
    border-radius: 12px;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.28);
}

.card-body {
    padding: 13px 14px 15px;
}

.card-body h3 {
    display: -webkit-box;
    min-height: 44px;
    margin: 0 0 7px;
    overflow: hidden;
    color: #111827;
    font-size: 15px;
    line-height: 1.45;
    font-weight: 850;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.2s ease;
}

.movie-card:hover .card-body h3 {
    color: #2563eb;
}

.card-meta,
.card-desc {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.card-desc {
    display: -webkit-box;
    min-height: 38px;
    margin-top: 8px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.rail-shell {
    position: relative;
}

.movie-rail {
    display: flex;
    gap: 22px;
    overflow-x: auto;
    padding: 2px 2px 18px;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.movie-rail::-webkit-scrollbar {
    display: none;
}

.rail-item {
    flex: 0 0 280px;
}

.rail-button {
    position: absolute;
    top: 42%;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #1f2937;
    background: #ffffff;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.18);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-size: 28px;
}

.rail-shell:hover .rail-button {
    opacity: 1;
}

.rail-button.left {
    left: -14px;
}

.rail-button.right {
    right: -14px;
}

.category-grid,
.category-large-grid,
.genre-chip-grid {
    display: grid;
    gap: 20px;
}

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

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

.genre-chip-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.category-tile,
.category-card-large,
.genre-chip-card {
    position: relative;
    overflow: hidden;
    min-height: 180px;
    color: #ffffff;
    background: #0f172a;
    border-radius: 22px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.category-tile img,
.category-card-large img,
.genre-chip-card img {
    width: 100%;
    height: 100%;
    min-height: inherit;
    object-fit: cover;
    opacity: 0.66;
    transition: transform 0.45s ease, opacity 0.45s ease;
}

.category-tile:hover img,
.category-card-large:hover img,
.genre-chip-card:hover img {
    opacity: 0.82;
    transform: scale(1.08);
}

.category-tile::after,
.category-card-large::after,
.genre-chip-card::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.84), rgba(15, 23, 42, 0.12));
}

.category-tile div,
.category-card-large div,
.genre-chip-card span {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 22px;
    z-index: 2;
}

.category-tile span,
.category-card-large span,
.genre-chip-card span {
    color: #bfdbfe;
    font-size: 13px;
    font-weight: 800;
}

.category-tile strong,
.category-card-large h2,
.genre-chip-card span {
    display: block;
    color: #ffffff;
    font-size: 26px;
    line-height: 1.15;
    font-weight: 900;
}

.category-card-large p {
    margin: 10px 0 0;
    color: #dbeafe;
}

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: start;
}

.ranking-panel,
.detail-card,
.side-card,
.search-page-box,
.filter-panel,
.page-hero {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 22px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.ranking-panel {
    position: sticky;
    top: 88px;
    padding: 22px;
}

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

.ranking-row {
    display: grid;
    grid-template-columns: 30px 54px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 8px;
    border-radius: 16px;
    transition: background 0.2s ease;
}

.ranking-row:hover {
    background: #f1f5f9;
}

.ranking-row > span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: #ffffff;
    background: #2563eb;
    border-radius: 10px;
    font-weight: 850;
}

.ranking-row img {
    width: 54px;
    height: 76px;
    object-fit: cover;
    border-radius: 12px;
}

.ranking-row strong {
    display: -webkit-box;
    overflow: hidden;
    color: #111827;
    font-size: 14px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ranking-row small {
    color: #64748b;
}

.page-hero {
    margin-bottom: 26px;
    padding: 34px;
    background: linear-gradient(135deg, #ffffff 0%, #e0f2fe 100%);
}

.page-hero.dark-card {
    color: #ffffff;
    background: linear-gradient(135deg, #0f172a, #1e3a8a 55%, #4c1d95);
}

.small-hero h1 {
    margin: 8px 0 10px;
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.small-hero p {
    max-width: 760px;
    margin: 0;
    color: #475569;
    font-size: 18px;
}

.dark-card p {
    color: #dbeafe;
}

.eyebrow {
    color: #2563eb;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.dark-card .eyebrow {
    color: #bfdbfe;
}

.filter-panel {
    display: flex;
    align-items: end;
    gap: 16px;
    margin-bottom: 24px;
    padding: 18px;
}

.filter-panel label {
    display: grid;
    flex: 1;
    gap: 8px;
    color: #334155;
    font-weight: 800;
}

.filter-panel input,
.filter-panel select,
.big-search input,
.advanced-filters select {
    width: 100%;
    min-height: 44px;
    color: #111827;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    outline: none;
    padding: 0 14px;
}

.filter-panel input:focus,
.filter-panel select:focus,
.big-search input:focus,
.advanced-filters select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.24);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 34px;
}

.pagination a {
    min-width: 42px;
    padding: 9px 13px;
    color: #1e293b;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
    font-weight: 800;
    transition: background 0.2s ease, color 0.2s ease;
}

.pagination a:hover,
.pagination a.active {
    color: #ffffff;
    background: #2563eb;
}

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

.breadcrumb a:hover {
    color: #2563eb;
}

.detail-container {
    padding-bottom: 56px;
}

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

.detail-main {
    min-width: 0;
}

.player-shell {
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    aspect-ratio: 16 / 9;
    background: #020617;
    border-radius: 22px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
}

.player-shell video {
    width: 100%;
    height: 100%;
    background: #020617;
    object-fit: contain;
}

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 12px;
    color: #ffffff;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.34));
    border: 0;
    cursor: pointer;
    text-align: center;
}

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

.play-circle {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    padding-left: 4px;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #9333ea);
    border-radius: 999px;
    box-shadow: 0 18px 46px rgba(37, 99, 235, 0.38);
    font-size: 34px;
}

.detail-card {
    padding: 26px;
}

.detail-card h1 {
    margin: 0 0 12px;
    color: #111827;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.1;
    font-weight: 900;
}

.detail-card h2 {
    margin: 28px 0 12px;
    color: #0f172a;
    font-size: 24px;
    font-weight: 900;
}

.detail-card p {
    color: #334155;
    font-size: 16px;
}

.lead-text {
    color: #1e293b;
    font-size: 18px;
    font-weight: 700;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.detail-meta span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    color: #1d4ed8;
    background: #dbeafe;
    font-size: 13px;
    font-weight: 800;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-side {
    position: sticky;
    top: 88px;
    display: grid;
    gap: 18px;
}

.detail-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 22px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.side-card {
    padding: 20px;
}

.side-card h2 {
    margin: 0 0 14px;
    color: #111827;
}

.side-card dl {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    margin: 0 0 20px;
}

.side-card dt {
    color: #64748b;
    font-weight: 800;
}

.side-card dd {
    margin: 0;
    color: #111827;
}

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

.search-page-box {
    display: grid;
    gap: 16px;
    margin-bottom: 32px;
    padding: 22px;
}

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

.big-search button {
    min-height: 48px;
    color: #ffffff;
    background: #2563eb;
    border: 0;
    border-radius: 14px;
    font-weight: 900;
    cursor: pointer;
}

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

.narrow-content {
    max-width: 860px;
}

.static-article {
    padding: 32px;
}

.site-footer {
    color: #cbd5e1;
    background: #0f172a;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 30px;
    padding: 46px 0;
}

.footer-brand {
    color: #ffffff;
    font-size: 20px;
}

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

.site-footer p {
    color: #94a3b8;
}

.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer li + li {
    margin-top: 8px;
}

.site-footer a {
    color: #cbd5e1;
    transition: color 0.2s ease;
}

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

.footer-bottom {
    padding: 18px;
    color: #94a3b8;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    text-align: center;
}

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

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

    .ranking-panel,
    .detail-side {
        position: static;
    }

    .detail-side {
        grid-template-columns: 240px minmax(0, 1fr);
    }
}

@media (max-width: 860px) {
    .desktop-nav,
    .header-inner > .site-search {
        display: none;
    }

    .mobile-toggle {
        display: inline-grid;
    }

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

    .mobile-search input {
        width: 100%;
    }

    .hero-slider,
    .hero-viewport,
    .hero-slide img {
        min-height: 480px;
    }

    .hero-content {
        bottom: 62px;
    }

    .hero-arrow {
        display: none;
    }

    .category-grid,
    .category-large-grid,
    .genre-chip-grid,
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .brand-text {
        font-size: 20px;
    }

    .hero-slider,
    .hero-viewport,
    .hero-slide img {
        min-height: 430px;
    }

    .hero-content {
        left: 18px;
        width: calc(100% - 36px);
    }

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

    .rail-item {
        flex-basis: 220px;
    }

    .category-grid,
    .category-large-grid,
    .genre-chip-grid,
    .footer-grid,
    .detail-side,
    .advanced-filters,
    .filter-panel,
    .big-search {
        grid-template-columns: 1fr;
    }

    .filter-panel {
        display: grid;
    }

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

    .detail-card,
    .page-hero,
    .search-page-box {
        padding: 22px;
    }
}
