:root {
    --bg: #f9fafb;
    --surface: #ffffff;
    --surface-soft: #f3f4f6;
    --text: #111827;
    --muted: #6b7280;
    --muted-strong: #374151;
    --line: #e5e7eb;
    --emerald: #059669;
    --emerald-dark: #047857;
    --emerald-soft: #d1fae5;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: linear-gradient(180deg, #f9fafb 0%, #ffffff 45%, #f9fafb 100%);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

img,
video {
    display: block;
    max-width: 100%;
}

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
    backdrop-filter: blur(18px);
}

.nav-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, #10b981, #047857);
    box-shadow: 0 12px 26px rgba(5, 150, 105, 0.28);
}

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

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--muted-strong);
    font-size: 15px;
    flex: 1;
}

.desktop-nav a:hover,
.footer-links a:hover,
.text-link:hover {
    color: var(--emerald);
}

.top-search {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    background: #ffffff;
    min-width: 300px;
}

.top-search input {
    border: 0;
    outline: 0;
    padding: 11px 14px;
    width: 100%;
    color: var(--text);
}

.top-search button {
    border: 0;
    color: #ffffff;
    background: var(--emerald);
    padding: 11px 18px;
}

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.menu-button span {
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

.mobile-nav {
    display: none;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px 18px;
    gap: 12px;
    flex-wrap: wrap;
}

.mobile-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted-strong);
}

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

.hero {
    position: relative;
    height: 70vh;
    min-height: 520px;
    overflow: hidden;
    background: #020617;
}

.hero-stage,
.hero-slide,
.hero-slide img,
.hero-shade {
    position: absolute;
    inset: 0;
}

.hero-slide {
    opacity: 0;
    transition: opacity 1000ms ease;
}

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.hero-shade {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.76) 0%, rgba(0, 0, 0, 0.54) 42%, rgba(0, 0, 0, 0.08) 100%);
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(1280px, calc(100% - 48px));
    transform: translate(-50%, -50%);
    color: #ffffff;
    max-width: 720px;
}

.eyebrow,
.section-head span,
.page-hero span {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    color: #ffffff;
    background: var(--emerald);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.hero h1 {
    font-size: clamp(42px, 7vw, 76px);
    line-height: 1.05;
    margin: 18px 0;
    font-weight: 900;
    letter-spacing: -0.05em;
}

.hero p {
    max-width: 680px;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(18px, 2.2vw, 23px);
    margin: 0 0 34px;
}

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

.primary-btn,
.ghost-btn,
.ghost-light-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    padding: 13px 22px;
    font-weight: 800;
    transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.primary-btn {
    color: #ffffff;
    background: var(--emerald);
    box-shadow: 0 16px 30px rgba(5, 150, 105, 0.3);
}

.primary-btn:hover {
    background: var(--emerald-dark);
    transform: translateY(-2px);
}

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

.ghost-light-btn:hover,
.ghost-btn:hover {
    background: rgba(255, 255, 255, 0.26);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    font-size: 34px;
    line-height: 1;
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 34px;
    display: flex;
    gap: 9px;
    transform: translateX(-50%);
}

.hero-dots button {
    width: 11px;
    height: 11px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.52);
    transition: width 240ms ease, background 240ms ease;
}

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

main {
    overflow: hidden;
}

.section-block,
.search-band,
.channel-grid,
.rank-page-list,
.breadcrumb,
.detail-hero,
.player-section,
.detail-content {
    width: min(1280px, calc(100% - 48px));
    margin-left: auto;
    margin-right: auto;
}

.section-block {
    padding: 52px 0;
}

.first-block {
    padding-top: 40px;
}

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

.section-head span {
    color: var(--emerald-dark);
    background: var(--emerald-soft);
    margin-bottom: 10px;
}

.section-head h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.12;
    letter-spacing: -0.04em;
}

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

.section-head > a,
.text-link {
    color: var(--emerald-dark);
    font-weight: 800;
}

.compact {
    align-items: center;
}

.search-band {
    margin-top: 38px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.search-band.slim {
    margin-top: 32px;
}

.search-panel {
    display: flex;
    gap: 14px;
    align-items: center;
}

.search-panel input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 15px 16px;
    outline: 0;
    background: #ffffff;
}

.search-panel input:focus,
.top-search input:focus {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}

.search-panel a {
    color: #ffffff;
    background: var(--emerald);
    padding: 14px 18px;
    border-radius: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 300px);
    gap: 20px;
    overflow-x: auto;
    padding: 6px 2px 22px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

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

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

.movie-grid,
.feature-grid,
.category-grid {
    display: grid;
    gap: 24px;
}

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

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

.feature-grid .movie-card-wide {
    grid-column: span 2;
}

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

.movie-card,
.channel-card,
.rank-item,
.category-tile {
    background: var(--surface);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.movie-card:hover,
.channel-card:hover,
.rank-item:hover,
.category-tile:hover {
    transform: translateY(-5px);
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: var(--shadow);
}

.poster-frame {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: radial-gradient(circle at 30% 20%, rgba(16, 185, 129, 0.35), rgba(2, 6, 23, 0.96));
}

.poster-frame img,
.rank-cover img,
.channel-covers img,
.category-tile img,
.detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 360ms ease, opacity 200ms ease;
}

.movie-card:hover .poster-frame img,
.category-tile:hover img,
.channel-card:hover img {
    transform: scale(1.055);
}

.image-muted {
    opacity: 0;
}

.poster-year {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 5px 9px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.68);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.card-body,
.rank-content {
    padding: 18px;
}

.card-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
}

.card-meta a,
.card-meta span,
.detail-meta span {
    border-radius: 999px;
    background: var(--surface-soft);
    padding: 5px 9px;
}

.card-meta a {
    color: var(--emerald-dark);
    background: var(--emerald-soft);
    font-weight: 800;
}

.movie-card h3,
.rank-item h3,
.channel-card h2 {
    margin: 0 0 10px;
    line-height: 1.25;
    font-size: 18px;
}

.movie-card h3 a:hover,
.rank-item h3 a:hover,
.channel-card h2 a:hover {
    color: var(--emerald-dark);
}

.movie-card p,
.rank-item p,
.channel-card p,
.category-tile p {
    margin: 0;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.tag-row span {
    color: var(--muted-strong);
    background: var(--surface-soft);
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
}

.tag-row.large span {
    font-size: 14px;
    padding: 7px 12px;
}

.movie-card-wide {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
}

.movie-card-wide .poster-frame {
    aspect-ratio: auto;
    min-height: 100%;
}

.category-tile {
    position: relative;
    min-height: 220px;
    color: #ffffff;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: end;
    isolation: isolate;
}

.category-tile:before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.72));
    z-index: -1;
}

.category-tile img {
    position: absolute;
    inset: 0;
    z-index: -2;
}

.category-tile span {
    font-size: 22px;
    font-weight: 900;
}

.category-tile p {
    color: rgba(255, 255, 255, 0.82);
    margin-top: 8px;
}

.rank-list,
.rank-page-list {
    display: grid;
    gap: 16px;
}

.rank-item {
    display: grid;
    grid-template-columns: 72px 168px 1fr;
    align-items: stretch;
}

.rank-number {
    display: grid;
    place-items: center;
    color: var(--emerald-dark);
    font-size: 28px;
    font-weight: 900;
    background: var(--emerald-soft);
}

.rank-cover {
    display: block;
    min-height: 108px;
    overflow: hidden;
    background: #111827;
}

.page-hero {
    color: #ffffff;
    min-height: 320px;
    display: flex;
    align-items: center;
    background: radial-gradient(circle at 16% 12%, rgba(16, 185, 129, 0.42), transparent 28%), linear-gradient(135deg, #041f1a 0%, #0f172a 62%, #111827 100%);
    padding: 74px 24px;
}

.page-hero > div {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
}

.page-hero h1 {
    margin: 16px 0 12px;
    font-size: clamp(36px, 6vw, 64px);
    letter-spacing: -0.05em;
    line-height: 1.05;
}

.page-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 18px;
}

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

.channel-card {
    display: grid;
    grid-template-columns: 220px 1fr;
}

.channel-covers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    min-height: 200px;
    background: #111827;
    overflow: hidden;
}

.channel-covers img {
    min-width: 0;
}

.channel-card > div {
    padding: 24px;
}

.breadcrumb {
    padding: 28px 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
}

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

.detail-hero {
    padding: 34px 0 42px;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 34px;
    align-items: center;
}

.detail-poster {
    aspect-ratio: 3 / 4;
    border-radius: 30px;
    overflow: hidden;
    background: radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.32), #111827);
    box-shadow: var(--shadow);
}

.detail-info h1 {
    margin: 18px 0 16px;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.lead {
    max-width: 780px;
    margin: 0 0 18px;
    color: var(--muted-strong);
    font-size: 20px;
}

.player-section {
    padding: 20px 0 46px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: #020617;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

.movie-player {
    width: 100%;
    height: 100%;
    background: #020617;
}

.player-start {
    position: absolute;
    inset: 0;
    border: 0;
    color: #ffffff;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.64));
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    font-weight: 900;
    font-size: 20px;
    transition: opacity 200ms ease, visibility 200ms ease;
}

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

.play-symbol {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--emerald);
    box-shadow: 0 16px 34px rgba(5, 150, 105, 0.35);
    padding-left: 5px;
}

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

.detail-content article {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 26px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.detail-content h2 {
    margin: 0 0 14px;
    font-size: 24px;
}

.detail-content p {
    margin: 0;
    color: var(--muted-strong);
}

.related-grid {
    padding-bottom: 24px;
}

.empty-state {
    display: none;
    padding: 28px;
    text-align: center;
    color: var(--muted);
    background: var(--surface-soft);
    border-radius: var(--radius);
}

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

.site-footer {
    margin-top: 46px;
    color: #d1d5db;
    background: #020617;
}

.footer-inner {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
    padding: 36px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

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

.footer-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-inner p {
    margin: 0;
    color: #9ca3af;
}

[hidden] {
    display: none !important;
}

@media (max-width: 1180px) {
    .top-search {
        display: none;
    }

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

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

    .channel-grid {
        grid-template-columns: 1fr;
    }
}

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

    .menu-button {
        display: inline-flex;
        margin-left: auto;
    }

    .hero {
        min-height: 620px;
    }

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

    .hero-arrow {
        display: none;
    }

    .section-block,
    .search-band,
    .channel-grid,
    .rank-page-list,
    .breadcrumb,
    .detail-hero,
    .player-section,
    .detail-content {
        width: min(100% - 32px, 1280px);
    }

    .section-head,
    .search-panel {
        align-items: stretch;
        flex-direction: column;
    }

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

    .movie-card-wide {
        grid-column: auto;
        grid-template-columns: 1fr;
    }

    .rank-item {
        grid-template-columns: 56px 118px 1fr;
    }

    .detail-hero {
        grid-template-columns: 1fr;
    }

    .detail-poster {
        max-width: 420px;
    }

    .detail-content {
        grid-template-columns: 1fr;
    }

    .channel-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .nav-wrap {
        min-height: 64px;
        padding: 0 16px;
    }

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

    .brand-mark {
        width: 38px;
        height: 38px;
    }

    .hero {
        height: 72vh;
        min-height: 560px;
    }

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

    .hero p {
        font-size: 17px;
    }

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

    .rail {
        grid-auto-columns: minmax(236px, 82vw);
    }

    .rank-item {
        grid-template-columns: 48px 92px 1fr;
    }

    .rank-number {
        font-size: 20px;
    }

    .rank-content {
        padding: 12px;
    }

    .rank-item p {
        -webkit-line-clamp: 2;
    }

    .page-hero {
        min-height: 280px;
        padding: 56px 16px;
    }

    .page-hero > div {
        width: 100%;
    }

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