:root {
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;
    --accent-400: #fbbf24;
    --accent-500: #f59e0b;
    --accent-600: #d97706;
    --neutral-50: #fafaf9;
    --neutral-100: #f5f5f4;
    --neutral-200: #e7e5e4;
    --neutral-300: #d6d3d1;
    --neutral-500: #78716c;
    --neutral-700: #44403c;
    --neutral-800: #292524;
    --neutral-900: #1c1917;
    --shadow-soft: 0 12px 30px rgba(12, 74, 110, 0.14);
    --shadow-card: 0 16px 40px rgba(28, 25, 23, 0.12);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: var(--neutral-900);
    background: linear-gradient(180deg, #f8fafc 0%, #fff 42%, #f5f5f4 100%);
}

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

img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-900), var(--primary-600));
}

button,
input {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    color: white;
    background: linear-gradient(90deg, var(--primary-900), var(--primary-700));
    box-shadow: 0 8px 28px rgba(12, 74, 110, 0.25);
}

.nav-wrap {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 68px;
}

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

.brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    color: var(--primary-900);
    background: var(--accent-400);
    box-shadow: 0 8px 18px rgba(251, 191, 36, 0.28);
}

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

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    font-size: 14px;
    font-weight: 600;
}

.desktop-nav a {
    opacity: 0.88;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    color: var(--accent-400);
    opacity: 1;
}

.nav-search {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.nav-search input {
    width: 160px;
    border: 0;
    padding: 9px 12px;
    color: white;
    outline: 0;
    background: transparent;
}

.nav-search input::placeholder {
    color: rgba(255, 255, 255, 0.72);
}

.nav-search button {
    border: 0;
    padding: 9px 14px;
    color: var(--primary-900);
    font-weight: 700;
    background: var(--accent-400);
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    margin-left: auto;
    border: 0;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
}

.mobile-toggle span {
    width: 22px;
    height: 2px;
    border-radius: 99px;
    background: white;
}

.mobile-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: min(100% - 32px, var(--container));
    margin: 0 auto;
    padding: 0 0 18px;
}

.mobile-menu a {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
}

.hero-slider {
    position: relative;
    overflow: hidden;
    min-height: 640px;
    color: white;
    background: var(--primary-900);
}

.hero-track {
    position: relative;
    min-height: 640px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
    transition: opacity 0.6s ease, transform 0.8s ease;
    background-image: var(--hero-image);
    background-position: center;
    background-size: cover;
}

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

.hero-overlay,
.page-hero-mask,
.detail-hero-mask {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 24%, rgba(251, 191, 36, 0.22), transparent 34%),
        linear-gradient(90deg, rgba(12, 74, 110, 0.96) 0%, rgba(12, 74, 110, 0.78) 44%, rgba(28, 25, 23, 0.52) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 48px;
    align-items: center;
    width: min(100% - 32px, var(--container));
    margin: 0 auto;
    padding: 110px 0 120px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent-400);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-title-row h1 {
    margin: 0;
    font-size: clamp(36px, 6vw, 68px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero-desc,
.page-hero p,
.detail-title-row p {
    max-width: 740px;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 18px;
    line-height: 1.8;
}

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

.hero-tags span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    color: var(--primary-900);
    font-size: 12px;
    font-weight: 700;
    background: rgba(251, 191, 36, 0.9);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

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

.btn:hover {
    transform: translateY(-2px);
}

.btn-accent {
    color: var(--primary-900);
    background: var(--accent-400);
    box-shadow: 0 14px 30px rgba(251, 191, 36, 0.28);
}

.btn-ghost {
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
}

.btn-dark {
    color: white;
    background: var(--primary-900);
}

.btn.full {
    width: 100%;
}

.hero-poster {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 28px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
    transform: rotate(2deg);
}

.hero-poster img {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
}

.hero-controls {
    position: absolute;
    z-index: 5;
    right: max(16px, calc((100% - var(--container)) / 2));
    bottom: 36px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero-prev,
.hero-next,
.hero-dot {
    border: 0;
    color: white;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
}

.hero-prev,
.hero-next {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
}

.hero-dots {
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 50%;
}

.hero-dot.active {
    width: 28px;
    border-radius: 999px;
    background: var(--accent-400);
}

.hero-search {
    position: absolute;
    z-index: 6;
    left: 50%;
    bottom: 36px;
    display: flex;
    width: min(560px, calc(100% - 32px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(14px);
    transform: translateX(-50%);
}

.hero-search input,
.search-page-form input {
    flex: 1;
    min-width: 0;
    border: 0;
    padding: 16px 20px;
    outline: 0;
    background: white;
}

.hero-search button {
    border: 0;
    padding: 0 24px;
    color: var(--primary-900);
    font-weight: 800;
    background: var(--accent-400);
}

.section {
    padding: 58px 0;
}

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

.section-head.compact {
    align-items: start;
    margin-bottom: 18px;
}

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

.section-head a,
.text-link {
    color: var(--primary-700);
    font-weight: 800;
}

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

.category-card,
.category-overview-card,
.prose-card,
.faq-card,
.meta-card,
.rank-panel {
    border: 1px solid rgba(214, 211, 209, 0.7);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

.category-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.category-posters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.category-posters img {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
}

.category-card strong,
.category-overview-card h2 {
    font-size: 20px;
    font-weight: 800;
}

.category-card em,
.category-overview-card p {
    color: var(--neutral-500);
    font-style: normal;
    line-height: 1.7;
}

.two-col-layout,
.ranking-layout,
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
}

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

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

.movie-card {
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: white;
    box-shadow: 0 10px 28px rgba(28, 25, 23, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--primary-900);
}

.poster-link img {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    transition: transform 0.35s ease, filter 0.35s ease;
}

.movie-card:hover .poster-link img {
    transform: scale(1.06);
    filter: saturate(1.08);
}

.poster-badge,
.poster-play {
    position: absolute;
    z-index: 2;
}

.poster-badge {
    top: 10px;
    left: 10px;
    max-width: calc(100% - 20px);
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--primary-900);
    font-size: 12px;
    font-weight: 800;
    background: var(--accent-400);
}

.poster-play {
    right: 12px;
    bottom: 12px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: white;
    background: rgba(12, 74, 110, 0.86);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.movie-info {
    padding: 14px;
}

.movie-info h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.4;
}

.movie-info h3 a:hover {
    color: var(--primary-700);
}

.movie-meta {
    margin: 8px 0 0;
    color: var(--neutral-500);
    font-size: 13px;
}

.movie-desc {
    display: -webkit-box;
    overflow: hidden;
    min-height: 44px;
    margin: 10px 0 0;
    color: var(--neutral-700);
    font-size: 14px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tag-row span {
    min-height: auto;
    color: var(--primary-800);
    background: var(--primary-100);
}

.rank-panel {
    padding: 20px;
}

.sticky-panel {
    position: sticky;
    top: 92px;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 34px 56px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 14px;
    background: var(--neutral-50);
    transition: background 0.2s ease, transform 0.2s ease;
}

.rank-row:hover {
    background: var(--primary-50);
    transform: translateX(3px);
}

.rank-num {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: var(--primary-900);
    font-weight: 900;
    background: var(--accent-400);
}

.rank-row img {
    width: 56px;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
}

.rank-text {
    min-width: 0;
}

.rank-text strong,
.rank-text em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-text em {
    margin-top: 4px;
    color: var(--neutral-500);
    font-size: 12px;
    font-style: normal;
}

.page-hero,
.detail-hero {
    position: relative;
    overflow: hidden;
    color: white;
    background: var(--primary-900);
    background-image: var(--page-image);
    background-position: center;
    background-size: cover;
}

.page-hero .container,
.detail-hero-inner {
    position: relative;
    z-index: 2;
    padding: 96px 0;
}

.compact-hero .container {
    padding: 76px 0;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 24px;
}

.filter-button {
    border: 1px solid var(--neutral-200);
    padding: 9px 14px;
    border-radius: 999px;
    color: var(--neutral-700);
    font-weight: 700;
    background: white;
}

.filter-button.active,
.filter-button:hover {
    color: var(--primary-900);
    border-color: var(--accent-400);
    background: var(--accent-400);
}

.category-overview-card {
    display: grid;
    gap: 18px;
    padding: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-cover-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.category-cover-strip img {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 36px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
}

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

.detail-title-row {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: end;
}

.detail-main {
    min-width: 0;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    background: #000;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

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

.play-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    gap: 12px;
    border: 0;
    color: white;
    background: linear-gradient(180deg, rgba(12, 74, 110, 0.1), rgba(12, 74, 110, 0.62));
}

.play-overlay span {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    color: var(--primary-900);
    font-size: 30px;
    background: var(--accent-400);
    box-shadow: 0 18px 45px rgba(251, 191, 36, 0.3);
}

.play-overlay strong {
    font-size: 20px;
}

.play-overlay.hidden {
    display: none;
}

.detail-article,
.prose-card,
.faq-card {
    margin-top: 24px;
    padding: 28px;
    line-height: 1.85;
}

.detail-article h2,
.prose-card h2,
.faq-card h2,
.meta-card h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.detail-article p,
.prose-card p,
.faq-card p {
    margin: 0 0 18px;
    color: var(--neutral-700);
}

.detail-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 24px;
    box-shadow: var(--shadow-card);
}

.meta-card {
    margin-top: 18px;
    padding: 20px;
}

.meta-card dl {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 10px 12px;
    margin: 0 0 18px;
}

.meta-card dt {
    color: var(--neutral-500);
    font-weight: 700;
}

.meta-card dd {
    margin: 0;
    color: var(--neutral-800);
}

.search-page-form {
    display: flex;
    gap: 12px;
    width: min(720px, 100%);
    margin-top: 26px;
}

.search-page-form input {
    border-radius: 999px;
}

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

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

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 34px;
    padding: 54px 0 36px;
}

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

.footer-grid p {
    max-width: 420px;
    margin: 14px 0 0;
    line-height: 1.8;
}

.footer-grid a:not(.footer-brand) {
    display: block;
    margin: 8px 0;
    color: var(--neutral-300);
}

.footer-grid a:hover {
    color: var(--accent-400);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 0;
    border-top: 1px solid var(--neutral-800);
    font-size: 14px;
}

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

    .mobile-toggle {
        display: flex;
    }

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

    .hero-content,
    .two-col-layout,
    .ranking-layout,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .hero-poster {
        display: none;
    }

    .rank-panel,
    .sticky-panel {
        position: static;
    }

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

@media (max-width: 760px) {
    .nav-wrap {
        min-height: 62px;
    }

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

    .nav-search {
        display: none;
    }

    .hero-slider,
    .hero-track {
        min-height: 600px;
    }

    .hero-content {
        padding: 88px 0 150px;
    }

    .hero-copy h1,
    .page-hero h1,
    .detail-title-row h1 {
        font-size: 38px;
    }

    .hero-search {
        bottom: 24px;
        flex-direction: column;
        border-radius: 22px;
    }

    .hero-search button {
        min-height: 48px;
    }

    .hero-controls {
        right: 16px;
        bottom: 124px;
    }

    .section-head,
    .detail-title-row,
    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

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

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

    .detail-side {
        order: -1;
    }

    .search-page-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .movie-grid,
    .movie-grid-compact,
    .category-grid,
    .category-overview-grid,
    .faq-grid {
        grid-template-columns: 1fr;
    }

    .mobile-menu {
        grid-template-columns: 1fr;
    }

    .rank-row {
        grid-template-columns: 32px 48px minmax(0, 1fr);
    }
}
