:root {
    --orange: #ea580c;
    --orange-dark: #c2410c;
    --red: #dc2626;
    --amber: #d97706;
    --text: #111827;
    --muted: #6b7280;
    --soft: #f9fafb;
    --line: #e5e7eb;
    --card: #ffffff;
    --shadow: 0 20px 25px -5px rgb(0 0 0 / 0.10), 0 8px 10px -6px rgb(0 0 0 / 0.10);
    --shadow-strong: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    color: #fff;
    background: linear-gradient(90deg, #d97706, #ea580c, #dc2626);
    box-shadow: 0 10px 25px rgb(0 0 0 / 0.20);
}

.nav-wrap {
    max-width: 1280px;
    height: 64px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.brand {
    font-size: 24px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    fill: currentColor;
    flex: 0 0 auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    font-weight: 600;
}

.nav-link {
    transition: color 0.2s ease, opacity 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #fde68a;
}

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: rgb(255 255 255 / 0.08);
    cursor: pointer;
}

.menu-button span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 5px auto;
    background: #fff;
    border-radius: 99px;
}

.mobile-menu {
    display: none;
    padding: 12px 24px 18px;
    background: #c2410c;
}

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

.mobile-link {
    display: block;
    padding: 11px 14px;
    border-radius: 8px;
    font-weight: 600;
}

.mobile-link:hover,
.mobile-link.active {
    background: rgb(255 255 255 / 0.10);
}

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

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease;
}

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.08) contrast(1.04);
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgb(0 0 0 / 0.92), rgb(0 0 0 / 0.48), rgb(0 0 0 / 0.08));
}

.hero-content {
    position: absolute;
    left: 50%;
    right: 0;
    bottom: 0;
    z-index: 2;
    width: min(1280px, calc(100% - 48px));
    transform: translateX(-50%);
    padding: 0 0 54px;
    color: #fff;
}

.hero-content h1 {
    max-width: 760px;
    margin: 0 0 16px;
    font-size: clamp(34px, 6vw, 64px);
    line-height: 1;
    font-weight: 900;
    text-shadow: 0 12px 32px rgb(0 0 0 / 0.45);
}

.hero-content p {
    max-width: 720px;
    margin: 0 0 24px;
    color: #e5e7eb;
    font-size: 18px;
    line-height: 1.7;
}

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

.hero-tag,
.chip,
.info-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.hero-tag {
    padding: 7px 12px;
    background: rgb(255 255 255 / 0.18);
    backdrop-filter: blur(8px);
}

.hero-tag.hot {
    background: #ea580c;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 26px;
}

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

.btn.primary {
    color: #fff;
    background: linear-gradient(90deg, #f97316, #dc2626);
    box-shadow: 0 20px 40px rgb(234 88 12 / 0.35);
}

.btn.ghost {
    color: #fff;
    border-color: rgb(255 255 255 / 0.35);
    background: rgb(255 255 255 / 0.12);
    backdrop-filter: blur(10px);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-strong);
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: rgb(0 0 0 / 0.35);
    cursor: pointer;
    font-size: 26px;
    transform: translateY(-50%);
}

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

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

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

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

.hero-dot.active {
    width: 30px;
    background: #ea580c;
}

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

.section {
    padding: 52px 0;
}

.section.alt {
    background: linear-gradient(90deg, #fff7ed, #fef2f2);
}

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

.section-head h2,
.page-hero h1,
.detail-title h1 {
    margin: 0;
    color: #111827;
    font-weight: 900;
}

.section-head h2 {
    font-size: 34px;
}

.section-head p {
    max-width: 680px;
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.more-link {
    color: var(--orange);
    font-weight: 800;
}

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

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

.movie-card {
    overflow: hidden;
    border-radius: 18px;
    background: var(--card);
    box-shadow: 0 10px 20px rgb(0 0 0 / 0.08);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-strong);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #111827, #7c2d12);
}

.movie-card.compact .poster-link {
    aspect-ratio: 16 / 9;
}

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

.movie-card:hover img,
.category-tile:hover img,
.related-card:hover img {
    transform: scale(1.06);
}

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgb(0 0 0 / 0.78), transparent 56%);
    opacity: 0;
    transition: opacity 0.28s ease;
}

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

.corner-label,
.rank-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 9px;
    border-radius: 8px;
    color: #fff;
    background: #f97316;
    font-size: 12px;
    font-weight: 800;
}

.rank-badge {
    left: 12px;
    right: auto;
    background: rgb(0 0 0 / 0.68);
}

.play-mark {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgb(234 88 12 / 0.92);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.86);
    transition: all 0.22s ease;
}

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

.card-body {
    padding: 18px;
}

.card-body h3 {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 800;
}

.card-body h3 a:hover,
.rank-row:hover strong,
.related-card:hover strong {
    color: var(--orange);
}

.meta-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 14px;
}

.card-body p {
    min-height: 44px;
    margin: 0 0 12px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chip,
.info-chip {
    padding: 5px 9px;
    color: #c2410c;
    background: #ffedd5;
}

.horizontal-scroll {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding: 0 0 18px;
    scrollbar-width: thin;
}

.horizontal-scroll .movie-card {
    width: 270px;
    flex: 0 0 auto;
}

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

.category-tile {
    position: relative;
    min-height: 160px;
    overflow: hidden;
    border-radius: 20px;
    color: #fff;
    background: linear-gradient(135deg, #ea580c, #dc2626);
    box-shadow: var(--shadow);
}

.category-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.32;
    transition: transform 0.3s ease;
}

.category-tile span {
    position: absolute;
    inset: auto 18px 18px 18px;
    z-index: 2;
}

.category-tile strong {
    display: block;
    font-size: 22px;
    font-weight: 900;
}

.category-tile em {
    display: block;
    margin-top: 4px;
    color: #ffedd5;
    font-style: normal;
    font-size: 13px;
}

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

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

.rank-panel,
.search-panel,
.detail-card,
.side-panel,
.page-card {
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow);
}

.rank-panel,
.search-panel,
.page-card {
    padding: 28px;
}

.rank-row {
    display: grid;
    grid-template-columns: 46px 118px 1fr;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 16px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.rank-row:hover {
    background: #fff7ed;
    transform: translateX(4px);
}

.rank-number {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #f97316, #dc2626);
    font-size: 18px;
    font-weight: 900;
}

.rank-row img {
    width: 118px;
    height: 74px;
    object-fit: cover;
    border-radius: 12px;
}

.rank-info strong,
.related-card strong {
    display: block;
    font-size: 16px;
    line-height: 1.35;
}

.rank-info em {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-style: normal;
    font-size: 13px;
}

.page-hero {
    padding: 58px 0;
    color: #fff;
    background: linear-gradient(90deg, #ea580c, #dc2626);
}

.page-hero h1 {
    color: #fff;
    font-size: clamp(32px, 5vw, 52px);
}

.page-hero p {
    max-width: 820px;
    margin: 14px 0 0;
    color: #ffedd5;
    font-size: 18px;
    line-height: 1.7;
}

.breadcrumb {
    margin-bottom: 16px;
    color: #fff7ed;
    font-weight: 700;
    font-size: 14px;
}

.breadcrumb a:hover {
    color: #fff;
}

.filter-bar {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, minmax(140px, 0.5fr));
    gap: 14px;
    margin-bottom: 28px;
}

.filter-bar input,
.filter-bar select {
    width: 100%;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0 14px;
    color: #111827;
    background: #fff;
    outline: none;
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgb(249 115 22 / 0.14);
}

.detail-player {
    background: #000;
}

.player-shell {
    width: min(1280px, 100%);
    margin: 0 auto;
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-shell video {
    width: 100%;
    height: 100%;
    background: #000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: #fff;
    background: rgb(0 0 0 / 0.32);
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.player-overlay:hover {
    background: rgb(0 0 0 / 0.48);
}

.player-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.player-button {
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #ea580c;
    box-shadow: 0 18px 45px rgb(234 88 12 / 0.42);
    font-size: 34px;
    transform: scale(1);
    transition: transform 0.2s ease, background 0.2s ease;
}

.player-overlay:hover .player-button {
    transform: scale(1.08);
    background: #c2410c;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 0.95fr);
    gap: 30px;
    padding: 36px 0 54px;
}

.detail-card {
    padding: 30px;
}

.detail-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.detail-title h1 {
    font-size: clamp(28px, 4vw, 42px);
}

.type-pill {
    flex: 0 0 auto;
    padding: 9px 14px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(90deg, #f97316, #dc2626);
    font-weight: 800;
    font-size: 14px;
}

.synopsis,
.review-box {
    color: #374151;
    line-height: 1.9;
    font-size: 16px;
}

.review-box {
    margin-top: 24px;
    padding: 20px;
    border-radius: 18px;
    background: linear-gradient(90deg, #fff7ed, #fef2f2);
}

.detail-card h2,
.side-panel h2 {
    margin: 26px 0 14px;
    font-size: 24px;
    font-weight: 900;
}

.side-panel {
    padding: 24px;
    align-self: start;
    position: sticky;
    top: 86px;
}

.related-list {
    display: grid;
    gap: 14px;
}

.related-card {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 12px;
    align-items: center;
}

.related-card img {
    width: 112px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.25s ease;
}

.related-card span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.footer {
    color: #d1d5db;
    background: linear-gradient(90deg, #111827, #1f2937, #111827);
}

.footer-inner {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
    padding: 46px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 38px;
}

.footer-brand {
    color: #fff;
    font-size: 22px;
}

.footer p {
    max-width: 360px;
    color: #d1d5db;
    line-height: 1.8;
}

.footer h3 {
    margin: 0 0 16px;
    color: #fff;
}

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

.footer-links a:hover {
    color: #fb923c;
}

.copyright {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid rgb(255 255 255 / 0.12);
    text-align: center;
    font-size: 14px;
}

.empty-state {
    display: none;
    padding: 24px;
    border-radius: 18px;
    background: #fff7ed;
    color: #9a3412;
    font-weight: 700;
}

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

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

    .side-panel {
        position: static;
    }
}

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

    .menu-button {
        display: block;
    }

    .hero {
        height: 520px;
    }

    .hero-control {
        display: none;
    }

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

    .section-head {
        display: block;
    }

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

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

@media (max-width: 560px) {
    .nav-wrap,
    .container,
    .footer-inner,
    .hero-content {
        width: calc(100% - 28px);
        padding-left: 0;
        padding-right: 0;
    }

    .brand {
        font-size: 20px;
    }

    .hero {
        height: 500px;
    }

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

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

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

    .rank-row {
        grid-template-columns: 38px 88px 1fr;
    }

    .rank-row img {
        width: 88px;
        height: 58px;
    }

    .detail-card,
    .rank-panel,
    .search-panel,
    .page-card {
        padding: 20px;
        border-radius: 18px;
    }
}
