:root {
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-900: #0c4a6e;
    --accent-50: #fef3c7;
    --accent-500: #d97706;
    --accent-600: #b45309;
    --secondary-50: #f8fafc;
    --secondary-100: #f1f5f9;
    --secondary-200: #e2e8f0;
    --secondary-300: #cbd5e1;
    --secondary-400: #94a3b8;
    --secondary-500: #64748b;
    --secondary-600: #475569;
    --secondary-700: #334155;
    --secondary-800: #1e293b;
    --secondary-900: #0f172a;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 10px 18px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.18);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--secondary-50);
    color: var(--secondary-900);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-sm);
}

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

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    color: var(--secondary-900);
}

.brand-icon {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    background: var(--primary-600);
    color: var(--white);
    box-shadow: 0 10px 22px rgba(2, 132, 199, 0.28);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    white-space: nowrap;
}

.nav-link,
.mobile-link {
    color: var(--secondary-700);
    font-weight: 600;
    transition: color 0.2s ease;
}

.nav-link:hover,
.mobile-link:hover {
    color: var(--primary-600);
}

.mobile-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: var(--secondary-100);
    cursor: pointer;
}

.mobile-menu-button span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    background: var(--secondary-700);
    border-radius: 2px;
}

.mobile-nav {
    display: grid;
    gap: 12px;
    padding: 0 0 18px;
}

.hero {
    position: relative;
    height: 600px;
    overflow: hidden;
    background: var(--secondary-900);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.6s ease, transform 1.1s ease;
    pointer-events: none;
}

.hero-slide.is-active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.24));
}

.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
}

.hero-copy {
    max-width: 720px;
    color: var(--white);
    animation: slideUp 0.6s ease both;
}

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

.hero-kicker span,
.genre-line span,
.tag-cloud a,
.tag-line span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.hero-kicker span {
    padding: 5px 12px;
    background: var(--primary-600);
}

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

.hero p {
    max-width: 660px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 19px;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0;
}

.hero-tags span {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.88);
}

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

.btn-primary,
.btn-ghost,
.quick-search button,
.search-panel button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 24px;
    border: 0;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary,
.quick-search button,
.search-panel button {
    background: var(--primary-600);
    color: var(--white);
    box-shadow: 0 12px 24px rgba(2, 132, 199, 0.25);
}

.btn-primary:hover,
.quick-search button:hover,
.search-panel button:hover {
    background: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(2, 132, 199, 0.30);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    color: var(--white);
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.2s ease;
}

.hero-arrow:hover {
    background: rgba(0, 0, 0, 0.55);
}

.hero-prev {
    left: 20px;
}

.hero-next {
    right: 20px;
}

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

.hero-dot {
    width: 34px;
    height: 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
}

.hero-dot.is-active {
    background: var(--white);
}

.search-band {
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.search-band-inner {
    display: grid;
    grid-template-columns: 1fr minmax(320px, 560px);
    align-items: center;
    gap: 24px;
    padding: 28px 0;
}

.search-band h2,
.section-heading h2,
.page-hero h1 {
    margin: 0;
    color: var(--secondary-900);
}

.search-band p,
.page-hero p,
.category-card p,
.card-body p,
.row-content p,
.footer-grid p,
.poster-panel p {
    color: var(--secondary-600);
}

.quick-search,
.search-panel {
    display: flex;
    gap: 10px;
}

.quick-search input,
.search-panel input,
.filter-bar input,
.filter-bar select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--secondary-200);
    border-radius: 12px;
    background: var(--white);
    color: var(--secondary-900);
    outline: none;
    padding: 0 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quick-search input:focus,
.search-panel input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.content-section {
    padding: 56px 0;
}

.section-soft {
    background: var(--white);
}

.section-gradient {
    background: linear-gradient(135deg, var(--primary-50), var(--accent-50));
}

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

.section-heading h2 {
    font-size: clamp(26px, 3vw, 38px);
    letter-spacing: -0.03em;
}

.section-link,
.card-link {
    color: var(--primary-600);
    font-weight: 800;
}

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

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

.card {
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.poster-wrap {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--secondary-200);
}

.poster-wrap img,
.row-cover img,
.poster-panel img,
.category-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.card:hover .poster-wrap img,
.media-row:hover .row-cover img,
.category-tile:hover .category-thumbs img {
    transform: scale(1.06);
}

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), transparent 62%);
    opacity: 0.82;
}

.poster-play,
.play-mark {
    position: absolute;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary-700);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.poster-play {
    top: 50%;
    left: 50%;
    width: 52px;
    height: 52px;
    transform: translate(-50%, -50%) scale(0.9);
}

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

.rating-badge,
.rank-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    color: var(--white);
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
}

.rank-badge {
    right: auto;
    left: 10px;
    background: var(--primary-600);
}

.card-body {
    padding: 16px;
}

.card-body h3,
.row-content h3 {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.35;
}

.card-body h3 a:hover,
.row-content h3 a:hover,
.category-card a:hover {
    color: var(--primary-600);
}

.card-body p,
.row-content p {
    display: -webkit-box;
    margin: 0 0 12px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.meta-line {
    color: var(--secondary-500);
    font-size: 13px;
}

.tag-line,
.genre-line,
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag-line span,
.genre-line span,
.tag-cloud a {
    padding: 5px 9px;
    background: var(--primary-50);
    color: var(--primary-700);
}

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

.category-tile,
.category-card {
    display: grid;
    gap: 18px;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-tile:hover,
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.category-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    height: 120px;
    overflow: hidden;
    border-radius: 14px;
}

.category-tile h3,
.category-card h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.category-card ul {
    display: grid;
    gap: 8px;
    margin: 14px 0;
    padding: 0;
    list-style: none;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 30px;
}

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

.media-row {
    display: grid;
    grid-template-columns: 138px 1fr;
    gap: 14px;
    align-items: stretch;
    overflow: hidden;
    border-radius: 16px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.media-row:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.row-cover {
    position: relative;
    min-height: 92px;
    overflow: hidden;
    background: var(--secondary-200);
}

.play-mark {
    inset: 50% auto auto 50%;
    width: 36px;
    height: 36px;
    transform: translate(-50%, -50%) scale(0.9);
}

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

.row-content {
    min-width: 0;
    padding: 14px 14px 14px 0;
}

.page-main {
    min-height: 62vh;
}

.page-hero {
    padding: 76px 0;
    background: linear-gradient(135deg, var(--primary-50), var(--accent-50));
}

.compact-page-hero {
    padding: 58px 0;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--primary-600);
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-hero h1 {
    margin-bottom: 12px;
    font-size: clamp(34px, 5vw, 58px);
    letter-spacing: -0.04em;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 18px;
    color: var(--secondary-600);
    font-size: 14px;
}

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

.breadcrumb.light {
    color: rgba(255, 255, 255, 0.78);
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 220px;
    gap: 16px;
    margin-bottom: 24px;
}

.filter-bar label {
    display: grid;
    gap: 7px;
    color: var(--secondary-700);
    font-weight: 800;
}

.empty-state,
.search-summary {
    color: var(--secondary-600);
    font-weight: 700;
    text-align: center;
}

.search-panel {
    max-width: 820px;
    margin: 0 auto 24px;
}

.search-summary {
    min-height: 30px;
    margin-bottom: 18px;
}

.detail-top {
    background: var(--secondary-900);
    padding: 30px 0 0;
}

.detail-main {
    background: linear-gradient(180deg, var(--secondary-900) 0, var(--secondary-900) 340px, var(--secondary-50) 340px);
}

.detail-content {
    padding: 22px 0 64px;
}

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

.player-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #000000;
    box-shadow: var(--shadow-lg);
}

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

.player-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 12px;
    border: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.28));
    color: var(--white);
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
}

.player-overlay.is-hidden {
    display: none;
}

.player-icon {
    display: grid;
    width: 78px;
    height: 78px;
    place-items: center;
    border-radius: 999px;
    background: var(--primary-600);
    color: var(--white);
    font-size: 30px;
    box-shadow: 0 18px 36px rgba(2, 132, 199, 0.32);
}

.detail-info {
    margin-top: 22px;
    padding: 28px;
}

.detail-info h1 {
    margin: 0 0 14px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.16;
    letter-spacing: -0.035em;
}

.detail-meta {
    color: var(--secondary-600);
    font-weight: 800;
}

.detail-meta span:first-child {
    color: var(--accent-600);
}

.one-line {
    margin: 22px 0;
    padding: 16px 18px;
    border-radius: 14px;
    background: var(--primary-50);
    color: var(--primary-900);
    font-weight: 800;
}

.detail-info h2,
.side-recommend h2,
.poster-panel h2 {
    margin: 24px 0 12px;
    font-size: 22px;
}

.detail-info p {
    color: var(--secondary-700);
}

.detail-sidebar {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 22px;
}

.poster-panel,
.side-recommend {
    padding: 20px;
}

.poster-panel img {
    aspect-ratio: 3 / 4;
    border-radius: 16px;
    background: var(--secondary-200);
}

.wide-list .media-row {
    grid-template-columns: 170px 1fr;
}

.site-footer {
    margin-top: 28px;
    background: var(--secondary-900);
    color: var(--secondary-300);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 32px;
    padding: 48px 0;
}

.footer-brand {
    color: var(--white);
    margin-bottom: 12px;
}

.footer-grid h2 {
    margin: 0 0 14px;
    color: var(--white);
    font-size: 18px;
}

.footer-grid ul {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-grid a:hover {
    color: var(--primary-500);
}

.footer-bottom {
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    padding: 22px 0;
    text-align: center;
}

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 45;
    display: none;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    background: var(--primary-600);
    color: var(--white);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.back-to-top.is-visible {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(26px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1180px) {
    .desktop-nav {
        gap: 14px;
        font-size: 14px;
    }

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

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

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

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

    .hero {
        height: 560px;
    }

    .hero-arrow {
        display: none;
    }

    .search-band-inner,
    .split-layout,
    .detail-grid,
    .category-grid,
    .category-overview-grid {
        grid-template-columns: 1fr;
    }

    .detail-sidebar {
        position: static;
    }

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

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

@media (max-width: 640px) {
    .container-custom {
        width: min(100% - 24px, 1280px);
    }

    .brand {
        font-size: 18px;
    }

    .hero {
        height: 520px;
    }

    .hero-content {
        align-items: end;
        padding-bottom: 72px;
    }

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

    .quick-search,
    .search-panel,
    .hero-actions {
        flex-direction: column;
    }

    .content-section {
        padding: 42px 0;
    }

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

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

    .card-body {
        padding: 13px;
    }

    .media-row,
    .wide-list .media-row {
        grid-template-columns: 112px 1fr;
    }

    .row-content p {
        -webkit-line-clamp: 1;
    }

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

    .detail-info {
        padding: 20px;
    }
}
