:root {
    color-scheme: dark;
    --bg: #0c0a09;
    --bg-soft: #1c1917;
    --bg-card: #292524;
    --line: #44403c;
    --line-soft: rgba(255, 255, 255, 0.08);
    --text: #fafaf9;
    --muted: #a8a29e;
    --muted-2: #78716c;
    --amber: #f59e0b;
    --amber-strong: #d97706;
    --amber-soft: rgba(245, 158, 11, 0.16);
    --shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.12), transparent 30rem),
        linear-gradient(180deg, #1c1917 0%, var(--bg) 18rem, #050505 100%);
    color: var(--text);
    min-height: 100vh;
}

body::selection {
    background: var(--amber);
    color: #111827;
}

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

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

button,
input,
select {
    font: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(28, 25, 23, 0.94);
    border-bottom: 1px solid var(--line-soft);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.nav-wrap {
    width: min(1220px, calc(100% - 32px));
    min-height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: max-content;
}

.brand-icon {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--amber), #ef4444);
    color: #111827;
    font-weight: 900;
    box-shadow: 0 12px 30px rgba(245, 158, 11, 0.28);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-text strong {
    font-size: 1.18rem;
    letter-spacing: 0.02em;
}

.brand-text small {
    color: var(--muted);
    margin-top: 3px;
}

.desktop-nav,
.quick-category-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.desktop-nav {
    margin-left: auto;
}

.desktop-nav a,
.quick-category-links a,
.mobile-nav a {
    color: #d6d3d1;
    border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.desktop-nav a {
    padding: 9px 14px;
    font-weight: 700;
}

.quick-category-links a {
    padding: 7px 10px;
    font-size: 0.88rem;
    color: var(--muted);
}

.desktop-nav a:hover,
.desktop-nav a.is-active,
.quick-category-links a:hover,
.mobile-nav a:hover,
.mobile-nav a.is-active {
    color: #111827;
    background: var(--amber);
}

.mobile-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    margin-left: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg-soft);
    color: var(--text);
}

.mobile-menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: currentColor;
}

.mobile-nav {
    display: none;
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.mobile-nav a {
    padding: 12px 14px;
    background: rgba(41, 37, 36, 0.9);
}

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

main {
    width: 100%;
}

.hero-carousel {
    position: relative;
    min-height: 650px;
    overflow: hidden;
    border-bottom: 1px solid var(--line-soft);
}

.hero-slides {
    position: relative;
    min-height: 650px;
}

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

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

.hero-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.08) contrast(1.06);
    transform: scale(1.04);
}

.hero-backdrop.is-missing,
.hero-poster img.is-missing,
.poster-frame img.is-missing,
.detail-poster img.is-missing {
    opacity: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 75% 50%, rgba(245, 158, 11, 0.18), transparent 24rem),
        linear-gradient(90deg, rgba(12, 10, 9, 0.96) 0%, rgba(12, 10, 9, 0.72) 46%, rgba(12, 10, 9, 0.36) 100%),
        linear-gradient(180deg, rgba(12, 10, 9, 0.15) 0%, rgba(12, 10, 9, 0.94) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1220px, calc(100% - 32px));
    min-height: 650px;
    margin: 0 auto;
    padding: 110px 420px 110px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--amber);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    font-size: clamp(2.5rem, 7vw, 5.8rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
    max-width: 820px;
}

.hero-summary {
    margin: 26px 0 0;
    color: #e7e5e4;
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.8;
    max-width: 720px;
}

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

.hero-meta {
    margin-top: 24px;
}

.hero-meta span,
.detail-meta span,
.detail-meta a,
.movie-meta span,
.year-badge {
    border: 1px solid rgba(245, 158, 11, 0.36);
    background: rgba(28, 25, 23, 0.72);
    color: #fde68a;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-weight: 800;
}

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

.hero-tags {
    margin-top: 18px;
}

.hero-tags span,
.tag-row span {
    color: #f5f5f4;
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.18);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.82rem;
}

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

.primary-button,
.ghost-button,
.section-link,
.filter-search-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 900;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-button {
    color: #111827;
    background: var(--amber);
    box-shadow: 0 18px 40px rgba(245, 158, 11, 0.24);
}

.ghost-button,
.section-link,
.filter-search-link {
    border: 1px solid var(--line);
    color: var(--text);
    background: rgba(41, 37, 36, 0.68);
}

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

.ghost-button:hover,
.section-link:hover,
.filter-search-link:hover {
    border-color: var(--amber);
    color: var(--amber);
}

.hero-poster {
    position: absolute;
    z-index: 2;
    right: max(32px, calc((100vw - 1220px) / 2));
    top: 50%;
    width: min(330px, 25vw);
    aspect-ratio: 2 / 3;
    transform: translateY(-50%) rotate(2deg);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, var(--bg-card), #111827);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

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

.hero-poster:hover img {
    transform: scale(1.05);
}

.hero-control {
    position: absolute;
    z-index: 4;
    top: 50%;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(12, 10, 9, 0.58);
    color: var(--text);
    font-size: 2rem;
    cursor: pointer;
}

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

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

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

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

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

.category-strip,
.content-section,
.page-hero,
.detail-hero,
.breadcrumb,
.player-section,
.detail-content,
.category-overview-block {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
}

.category-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 34px 0 8px;
}

.category-tile {
    min-height: 156px;
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--line-soft);
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.11), transparent),
        rgba(41, 37, 36, 0.72);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(245, 158, 11, 0.45);
}

.category-tile strong {
    display: block;
    font-size: 1.2rem;
}

.category-tile span,
.category-tile p,
.section-heading p,
.page-hero p,
.detail-one-line,
.detail-content p,
.site-footer p,
.movie-line,
.player-message {
    color: var(--muted);
    line-height: 1.75;
}

.content-section,
.category-overview-block {
    padding: 48px 0;
}

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

.section-heading h2,
.detail-content h2,
.site-footer h2 {
    margin: 0;
    font-size: clamp(1.55rem, 3vw, 2.3rem);
    line-height: 1.1;
}

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: rgba(41, 37, 36, 0.75);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(245, 158, 11, 0.44);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.36);
}

.poster-frame {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 20%, rgba(245, 158, 11, 0.18), transparent 12rem),
        var(--bg-soft);
}

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

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

.year-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.62);
}

.play-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    transform: translate(-50%, -50%) scale(0.6);
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.88);
    color: #111827;
    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: 14px;
}

.movie-card h3 {
    min-height: 2.8em;
    margin: 0 0 8px;
    font-size: 1rem;
    line-height: 1.35;
}

.movie-card h3 a:hover {
    color: var(--amber);
}

.movie-line {
    display: -webkit-box;
    min-height: 3.5em;
    margin: 0 0 12px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 0.9rem;
}

.movie-meta {
    gap: 6px;
    margin-bottom: 10px;
}

.movie-meta span {
    border-color: var(--line-soft);
    color: var(--muted);
    padding: 3px 8px;
    font-size: 0.75rem;
}

.tag-row span {
    padding: 3px 8px;
    font-size: 0.72rem;
}

.filter-panel {
    margin-bottom: 26px;
    padding: 18px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: rgba(28, 25, 23, 0.82);
}

.filter-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    margin-bottom: 14px;
}

.filter-search input,
.filter-controls select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #0c0a09;
    color: var(--text);
    outline: none;
}

.filter-search input {
    padding: 0 15px;
}

.filter-search input:focus,
.filter-controls select:focus {
    border-color: var(--amber);
}

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

.filter-controls label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.filter-controls select {
    padding: 0 12px;
}

.filter-count {
    margin: 12px 0 0;
    color: var(--muted);
}

.rank-list {
    display: grid;
    gap: 10px;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    background: rgba(41, 37, 36, 0.72);
}

.rank-item:hover {
    border-color: var(--amber);
    background: rgba(245, 158, 11, 0.09);
}

.rank-number {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--amber-soft);
    color: var(--amber);
    font-weight: 900;
}

.rank-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.rank-meta {
    color: var(--muted);
    font-size: 0.88rem;
}

.page-hero {
    padding: 72px 0 26px;
}

.compact-hero {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.compact-hero h1 {
    font-size: clamp(2.35rem, 6vw, 4.2rem);
}

.compact-hero p {
    max-width: 760px;
    font-size: 1.05rem;
}

.breadcrumb {
    padding: 24px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

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

.detail-hero {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 36px;
    align-items: center;
    padding: 44px 0 28px;
}

.detail-poster {
    overflow: hidden;
    border-radius: 28px;
    background: var(--bg-soft);
    box-shadow: var(--shadow);
    border: 1px solid var(--line-soft);
}

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

.detail-one-line {
    max-width: 850px;
    font-size: 1.15rem;
}

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

.detail-tags {
    margin: 0 0 28px;
}

.player-section {
    padding: 28px 0 44px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: #000;
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow);
}

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

.player-start {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 12px;
    border: 0;
    background:
        radial-gradient(circle, rgba(245, 158, 11, 0.16), rgba(0, 0, 0, 0.74)),
        rgba(0, 0, 0, 0.32);
    color: var(--text);
    font-weight: 900;
    cursor: pointer;
}

.player-start span {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    margin: 0 auto;
    border-radius: 999px;
    background: var(--amber);
    color: #111827;
    font-size: 2rem;
    box-shadow: 0 24px 60px rgba(245, 158, 11, 0.35);
}

.player-shell.is-playing .player-start {
    display: none;
}

.player-message {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 14px;
    margin: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.74);
    pointer-events: none;
}

.player-shell.is-playing .player-message {
    display: none;
}

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

.detail-content article {
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--line-soft);
    background: rgba(41, 37, 36, 0.7);
}

.detail-content h2 {
    font-size: 1.35rem;
    margin-bottom: 12px;
}

.site-footer {
    margin-top: 56px;
    border-top: 1px solid var(--line-soft);
    background: rgba(12, 10, 9, 0.92);
}

.footer-grid {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 44px 0;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 28px;
}

.footer-brand {
    margin-bottom: 14px;
}

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

.footer-links a {
    color: var(--muted);
}

.footer-links a:hover {
    color: var(--amber);
}

.footer-bottom {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 28px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    color: var(--muted-2);
    border-top: 1px solid var(--line-soft);
}

.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 80;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: var(--amber);
    color: #111827;
    font-weight: 900;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

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

@media (max-width: 1100px) {
    .quick-category-links {
        display: none;
    }

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

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

    .hero-content {
        padding-right: 310px;
    }

    .hero-poster {
        width: 270px;
    }
}

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

    .mobile-menu-button {
        display: block;
    }

    .hero-carousel,
    .hero-slides,
    .hero-content {
        min-height: 720px;
    }

    .hero-content {
        padding: 72px 0 310px;
    }

    .hero-poster {
        top: auto;
        right: 50%;
        bottom: 64px;
        width: 210px;
        transform: translateX(50%) rotate(1deg);
    }

    .hero-control {
        display: none;
    }

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

    .home-rank-list,
    .detail-content,
    .footer-grid,
    .filter-controls,
    .detail-hero {
        grid-template-columns: 1fr;
    }

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

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

    .rank-item {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .rank-meta {
        grid-column: 2;
    }

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

@media (max-width: 520px) {
    .nav-wrap,
    .mobile-nav,
    .category-strip,
    .content-section,
    .page-hero,
    .detail-hero,
    .breadcrumb,
    .player-section,
    .detail-content,
    .category-overview-block,
    .footer-grid,
    .footer-bottom {
        width: min(100% - 22px, 1220px);
    }

    .brand-text strong {
        font-size: 1rem;
    }

    .hero-content h1,
    .page-hero h1,
    .detail-info h1 {
        letter-spacing: -0.04em;
    }

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

    .movie-grid,
    .small-grid {
        gap: 12px;
    }

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

    .movie-line {
        font-size: 0.82rem;
    }

    .player-start span {
        width: 64px;
        height: 64px;
    }
}
