:root {
    --bg: #0f172a;
    --bg-soft: #111827;
    --panel: #1e293b;
    --panel-strong: #273449;
    --line: rgba(148, 163, 184, 0.22);
    --text: #ffffff;
    --muted: #cbd5e1;
    --soft: #94a3b8;
    --accent: #f59e0b;
    --accent-strong: #ea580c;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
    --radius: 22px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.12), transparent 28rem), linear-gradient(180deg, #0f172a 0%, #162033 46%, #0f172a 100%);
    color: var(--text);
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.header-inner,
.footer-inner,
.content-section,
.search-panel,
.breadcrumb,
.detail-hero,
.player-section,
.detail-body {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

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

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

.brand-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    box-shadow: 0 12px 28px rgba(249, 115, 22, 0.35);
}

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

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff;
    background: rgba(245, 158, 11, 0.16);
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    color: #ffffff;
    background: rgba(71, 85, 105, 0.55);
}

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

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

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, #1e293b, #0f172a);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, #0f172a 0%, rgba(15, 23, 42, 0.76) 42%, rgba(15, 23, 42, 0.25) 100%);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100% - 1280px) / 2));
    right: max(24px, calc((100% - 1280px) / 2));
    bottom: 76px;
    max-width: 780px;
}

.hero-label,
.detail-kicker,
.page-hero span,
.section-heading span {
    display: inline-flex;
    color: #fbbf24;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-content h1,
.hero-content h2 {
    margin: 12px 0 0;
    font-size: clamp(38px, 7vw, 74px);
    line-height: 0.96;
    font-weight: 900;
    text-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
}

.hero-content h2 + p,
.hero-content h1 + h2 + p {
    margin-top: 18px;
}

.hero-content p {
    max-width: 700px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.75;
}

.hero-tags,
.tag-row,
.detail-meta,
.rank-meta,
.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.hero-tags span,
.tag-row span,
.detail-meta span,
.rank-meta span,
.card-meta span {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.55);
    color: var(--muted);
    padding: 5px 10px;
    font-size: 12px;
}

.hero-actions,
.section-heading,
.search-controls,
.filter-toolbar,
.quick-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.hero-actions {
    margin-top: 26px;
}

.primary-button,
.ghost-button,
.quick-search button,
.search-controls button,
.filter-toolbar button {
    border: 0;
    border-radius: 999px;
    padding: 13px 24px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.primary-button,
.quick-search button {
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 18px 38px rgba(234, 88, 12, 0.34);
}

.ghost-button {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(15, 23, 42, 0.56);
}

.primary-button:hover,
.ghost-button:hover,
.quick-search button:hover,
.filter-toolbar button:hover {
    transform: translateY(-2px) scale(1.02);
}

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

.hero-prev {
    left: 18px;
}

.hero-next {
    right: 18px;
}

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

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

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

.search-panel,
.content-section,
.player-section,
.detail-body,
.breadcrumb {
    margin-top: 56px;
}

.search-panel,
.story-card,
.video-shell,
.ranking-panel,
.category-overview-card,
.category-card,
.page-hero,
.detail-hero,
.search-controls,
.filter-toolbar {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(30, 41, 59, 0.78);
    box-shadow: var(--shadow);
}

.search-panel {
    display: grid;
    grid-template-columns: minmax(240px, 0.9fr) minmax(260px, 1.5fr);
    gap: 24px;
    padding: 26px;
    transform: translateY(-30px);
}

.quick-search input,
.search-controls input,
.search-controls select,
.filter-toolbar input {
    min-height: 52px;
    border: 1px solid var(--line);
    border-radius: 999px;
    outline: 0;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.78);
    padding: 0 18px;
}

.quick-search input {
    flex: 1 1 360px;
}

.section-heading {
    justify-content: space-between;
    margin-bottom: 26px;
}

.section-heading h2,
.story-card h2 {
    margin: 4px 0 0;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.1;
}

.section-heading a {
    color: #fbbf24;
    font-weight: 800;
}

.featured-grid,
.movie-grid,
.category-overview-grid {
    display: grid;
    gap: 22px;
}

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

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

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

.movie-card {
    overflow: hidden;
    border-radius: 18px;
    background: rgba(30, 41, 59, 0.92);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24);
    transition: transform 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
}

.movie-card:hover {
    transform: translateY(-5px) scale(1.015);
    background: rgba(39, 52, 73, 0.98);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.35);
}

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

.featured-card .poster-frame {
    aspect-ratio: 16 / 10;
}

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

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

.card-badge,
.card-play {
    position: absolute;
    display: inline-grid;
    place-items: center;
}

.card-badge {
    top: 12px;
    right: 12px;
    min-width: 52px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.95);
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
}

.card-play {
    left: 50%;
    top: 50%;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.95);
    transform: translate(-50%, -50%) scale(0.82);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.card-body {
    padding: 18px;
}

.card-body h2 {
    margin: 12px 0 8px;
    font-size: 18px;
    line-height: 1.28;
}

.card-body p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.movie-rail {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding: 4px 4px 18px;
    scrollbar-color: #475569 #1e293b;
}

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

.two-column-section {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
    gap: 26px;
}

.ranking-panel {
    padding: 14px;
}

.ranking-row {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
    transition: background 0.25s ease, transform 0.25s ease;
}

.full-ranking .ranking-row {
    grid-template-columns: 56px 86px minmax(0, 1fr);
}

.ranking-row:hover {
    background: rgba(51, 65, 85, 0.82);
    transform: translateX(3px);
}

.rank-number {
    color: #fbbf24;
    font-size: 24px;
    font-weight: 900;
    text-align: center;
}

.rank-thumb {
    overflow: hidden;
    border-radius: 12px;
    background: #0f172a;
}

.rank-thumb img {
    width: 86px;
    height: 64px;
    object-fit: cover;
}

.rank-title {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 18px;
    font-weight: 850;
}

.rank-title:hover {
    color: #fbbf24;
}

.rank-content p {
    margin: 0 0 8px;
    color: var(--muted);
    line-height: 1.55;
}

.category-mini-list {
    display: grid;
    gap: 16px;
}

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

.category-card a,
.category-overview-card a {
    display: grid;
    gap: 14px;
    min-height: 100%;
    padding: 22px;
}

.category-card:hover,
.category-overview-card:hover {
    transform: translateY(-4px);
    background: rgba(39, 52, 73, 0.98);
}

.category-kicker,
.category-overview-card span {
    color: #fbbf24;
    font-weight: 900;
}

.category-card h2,
.category-overview-card h2 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    line-height: 1.45;
}

.category-card ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    color: var(--muted);
    list-style: none;
}

.category-card li a:hover,
.category-preview-links a:hover {
    color: #fbbf24;
}

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

.category-preview-links {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.category-preview-links a {
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.55);
    color: var(--muted);
    padding: 6px 10px;
    font-size: 13px;
}

.page-hero {
    width: min(1280px, calc(100% - 32px));
    margin: 44px auto 0;
    padding: 58px;
    background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.24), transparent 28rem), linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.92));
}

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

.page-hero p {
    max-width: 780px;
    margin: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.75;
}

.filter-toolbar,
.search-controls {
    margin-bottom: 28px;
    padding: 18px;
}

.filter-toolbar button {
    color: var(--muted);
    background: rgba(71, 85, 105, 0.55);
}

.filter-toolbar button.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.search-controls input {
    flex: 1 1 320px;
}

.search-controls select {
    min-width: 160px;
}

.empty-state {
    display: none;
    padding: 40px;
    color: var(--muted);
    text-align: center;
}

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

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--soft);
}

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

.detail-hero {
    display: grid;
    grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
    gap: 34px;
    padding: 28px;
}

.detail-poster {
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(135deg, #1e293b, #020617);
}

.detail-poster img {
    width: 100%;
    height: 100%;
    min-height: 420px;
    object-fit: cover;
}

.detail-info {
    align-self: center;
}

.detail-info h1 {
    margin: 12px 0 18px;
    font-size: clamp(34px, 6vw, 64px);
    line-height: 1.06;
}

.detail-one-line {
    max-width: 780px;
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 19px;
    line-height: 1.75;
}

.detail-tags {
    margin: 20px 0 26px;
}

.video-shell {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #020617;
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: #ffffff;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.38));
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-overlay span {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 20px 50px rgba(234, 88, 12, 0.38);
    font-size: 34px;
    padding-left: 6px;
}

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

.player-title-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 4px 0;
    color: var(--muted);
}

.player-title-bar strong {
    color: #ffffff;
}

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

.story-card {
    padding: 28px;
}

.story-card p {
    color: var(--muted);
    font-size: 17px;
    line-height: 1.9;
}

.site-footer {
    margin-top: 80px;
    border-top: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.92);
}

.footer-inner {
    padding: 42px 0 28px;
}

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

.footer-brand {
    margin-bottom: 12px;
    color: #ffffff;
    font-size: 22px;
}

.footer-grid p,
.footer-bottom {
    color: var(--soft);
    line-height: 1.7;
}

.footer-grid h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

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

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

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

.footer-bottom {
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 14px;
}

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

    .two-column-section,
    .detail-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .menu-toggle {
        display: inline-grid;
        place-items: center;
    }

    .site-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 76px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: rgba(15, 23, 42, 0.98);
        padding: 12px;
        box-shadow: var(--shadow);
    }

    .site-nav.open {
        display: flex;
    }

    .hero-carousel {
        height: 560px;
    }

    .hero-content {
        bottom: 70px;
    }

    .search-panel,
    .detail-hero,
    .footer-grid,
    .category-overview-grid {
        grid-template-columns: 1fr;
    }

    .page-hero {
        padding: 36px 24px;
    }

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

    .full-ranking .ranking-row {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .rank-thumb {
        display: none;
    }
}

@media (max-width: 520px) {
    .header-inner,
    .footer-inner,
    .content-section,
    .search-panel,
    .breadcrumb,
    .detail-hero,
    .player-section,
    .detail-body {
        width: min(100% - 22px, 1280px);
    }

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

    .hero-carousel {
        height: 540px;
    }

    .hero-content h1,
    .hero-content h2 {
        font-size: 36px;
    }

    .hero-arrow {
        display: none;
    }

    .movie-grid,
    .compact-grid,
    .featured-grid {
        grid-template-columns: 1fr;
    }

    .rail-item {
        width: 245px;
        flex-basis: 245px;
    }

    .detail-poster img {
        min-height: 300px;
    }

    .player-overlay span {
        width: 68px;
        height: 68px;
        font-size: 28px;
    }
}
