:root {
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-900: #1e3a8a;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-500: #64748b;
    --slate-700: #334155;
    --slate-900: #0f172a;
    --white: #ffffff;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
    --shadow-card: 0 12px 30px rgba(15, 23, 42, 0.10);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--slate-50);
    color: var(--slate-900);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

img {
    display: block;
    width: 100%;
    height: auto;
}

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(18px);
}

.header-inner {
    max-width: 1200px;
    height: 68px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

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

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

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background: linear-gradient(135deg, var(--blue-600), var(--blue-900));
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.nav-panel {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
    flex: 1;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.main-nav a {
    color: var(--slate-700);
    font-weight: 700;
    transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.is-active {
    color: var(--blue-600);
}

.top-search,
.hero-search,
.search-panel,
.category-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-search input,
.hero-search input,
.search-panel input,
.category-filter input {
    min-width: 220px;
    border: 1px solid var(--slate-200);
    border-radius: 999px;
    background: var(--white);
    color: var(--slate-900);
    padding: 11px 16px;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.top-search input:focus,
.hero-search input:focus,
.search-panel input:focus,
.category-filter input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.top-search button,
.hero-search button,
.search-panel button,
.primary-button,
.secondary-button,
.category-filter button {
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    color: var(--white);
    background: var(--blue-600);
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.20);
}

.top-search button:hover,
.hero-search button:hover,
.search-panel button:hover,
.primary-button:hover,
.category-filter button:hover {
    background: var(--blue-700);
    transform: translateY(-1px);
}

.secondary-button {
    color: var(--blue-600);
    background: var(--white);
}

.secondary-button:hover {
    background: var(--blue-50);
    transform: translateY(-1px);
}

.menu-button {
    display: none;
    border: 0;
    border-radius: 12px;
    background: var(--blue-50);
    color: var(--blue-700);
    padding: 9px 12px;
    font-size: 20px;
    cursor: pointer;
}

main {
    min-height: 70vh;
}

.hero-carousel {
    position: relative;
    overflow: hidden;
    min-height: 540px;
    background: linear-gradient(115deg, var(--blue-900), var(--blue-700));
}

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

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

.hero-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.34;
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 78% 30%, rgba(96, 165, 250, 0.18), transparent 34%), linear-gradient(90deg, rgba(15, 23, 42, 0.84), rgba(30, 64, 175, 0.45));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    min-height: 540px;
    margin: 0 auto;
    padding: 70px 20px 56px;
    display: grid;
    align-items: center;
}

.hero-copy {
    max-width: 700px;
    color: var(--white);
}

.hero-kicker,
.page-kicker,
.detail-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 7px 13px;
    color: var(--blue-700);
    background: var(--blue-100);
    font-size: 14px;
    font-weight: 800;
}

.hero-kicker {
    color: var(--white);
    background: rgba(59, 130, 246, 0.92);
}

.hero-copy h1,
.hero-copy h2 {
    margin: 18px 0 18px;
    font-size: clamp(40px, 6vw, 70px);
    line-height: 1.04;
    letter-spacing: -0.05em;
    font-weight: 900;
}

.hero-copy p {
    max-width: 650px;
    margin: 0 0 26px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 18px;
    line-height: 1.8;
}

.hero-actions,
.section-actions,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.hero-search {
    margin-top: 26px;
    max-width: 620px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
}

.hero-search input {
    flex: 1;
    min-width: 180px;
    border: 0;
}

.hero-controls {
    position: absolute;
    right: max(20px, calc((100vw - 1200px) / 2));
    bottom: 36px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-controls button,
.hero-dots button {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.hero-dots {
    position: absolute;
    left: max(20px, calc((100vw - 1200px) / 2));
    bottom: 42px;
    z-index: 3;
    display: flex;
    gap: 8px;
}

.hero-dots button {
    width: 11px;
    height: 11px;
    padding: 0;
    border: 0;
    background: rgba(255, 255, 255, 0.42);
}

.hero-dots button.is-active {
    width: 32px;
    border-radius: 999px;
    background: var(--white);
}

.page-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 54px 20px 0;
}

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

.section-header h2,
.page-title h1,
.detail-copy h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.16;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.section-header p,
.page-title p,
.detail-copy p {
    margin: 10px 0 0;
    color: var(--slate-500);
    line-height: 1.75;
}

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.86);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-card);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 22px 46px rgba(15, 23, 42, 0.16);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, var(--blue-100), var(--slate-100));
}

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

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

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    border-radius: 999px;
    padding: 5px 9px;
    color: var(--white);
    background: rgba(37, 99, 235, 0.92);
    font-size: 12px;
    font-weight: 800;
}

.card-play {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--blue-600);
    background: rgba(255, 255, 255, 0.94);
    font-size: 15px;
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.25);
}

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

.movie-card h3 {
    margin: 0 0 9px;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 850;
}

.movie-card h3 a:hover,
.ranking-item h3 a:hover,
.text-link:hover {
    color: var(--blue-600);
}

.movie-card p {
    min-height: 46px;
    margin: 0 0 12px;
    color: var(--slate-500);
    font-size: 14px;
    line-height: 1.65;
}

.card-meta,
.ranking-meta,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--slate-500);
    font-size: 13px;
}

.card-meta span,
.ranking-meta span,
.detail-meta span {
    border-radius: 999px;
    padding: 4px 8px;
    background: var(--slate-100);
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.tag-row span {
    border-radius: 8px;
    padding: 4px 7px;
    color: var(--blue-700);
    background: var(--blue-50);
    font-size: 12px;
    font-weight: 700;
}

.category-strip,
.category-grid {
    display: grid;
    gap: 18px;
}

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

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

.category-card {
    position: relative;
    min-height: 160px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    color: var(--white);
    background: linear-gradient(135deg, var(--blue-700), var(--blue-900));
    box-shadow: var(--shadow-card);
}

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

.category-card:hover img {
    transform: scale(1.06);
}

.category-card div {
    position: relative;
    z-index: 1;
    min-height: 160px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.72));
}

.category-card h3 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 900;
}

.category-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.6;
}

.page-hero,
.detail-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
    color: var(--white);
}

.page-hero::after,
.detail-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 78% 20%, rgba(147, 197, 253, 0.22), transparent 32%);
}

.page-title,
.detail-inner {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 64px 20px;
}

.page-title p,
.detail-copy p {
    color: rgba(255, 255, 255, 0.84);
}

.page-kicker,
.detail-kicker {
    color: var(--white);
    background: rgba(255, 255, 255, 0.16);
}

.category-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 18px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-card);
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-pills a {
    border-radius: 999px;
    padding: 9px 14px;
    color: var(--slate-700);
    background: var(--slate-100);
    font-weight: 800;
}

.category-pills a:hover,
.category-pills a.is-active {
    color: var(--white);
    background: var(--blue-600);
}

.ranking-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 24px;
}

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

.ranking-item {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    padding: 12px;
    box-shadow: var(--shadow-card);
}

.ranking-poster {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 14px;
    background: var(--slate-100);
}

.ranking-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ranking-poster span {
    position: absolute;
    top: 8px;
    left: 8px;
    min-width: 34px;
    border-radius: 999px;
    padding: 5px 8px;
    color: var(--white);
    background: var(--blue-600);
    text-align: center;
    font-weight: 900;
}

.ranking-item h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 900;
}

.ranking-item p {
    margin: 0 0 12px;
    color: var(--slate-500);
    line-height: 1.65;
}

.side-panel {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-xl);
    background: var(--white);
    padding: 22px;
    box-shadow: var(--shadow-soft);
    align-self: start;
}

.side-panel h2 {
    margin: 0 0 16px;
    font-size: 24px;
    font-weight: 900;
}

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

.side-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 14px;
    padding: 13px 14px;
    background: var(--slate-100);
    color: var(--slate-700);
    font-weight: 800;
}

.side-links a:hover {
    color: var(--white);
    background: var(--blue-600);
}

.detail-inner {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 36px;
    align-items: center;
}

.detail-poster {
    overflow: hidden;
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.35);
    background: rgba(255, 255, 255, 0.12);
}

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

.detail-copy h1 {
    margin-top: 16px;
    color: var(--white);
}

.detail-actions {
    margin-top: 24px;
}

.player-section,
.detail-content,
.related-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 20px 0;
}

.player-section h2,
.detail-content h2,
.related-section h2 {
    margin: 0 0 20px;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.player-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: #020617;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.22);
    aspect-ratio: 16 / 9;
}

.player-card video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 0;
    color: var(--white);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0.72));
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-overlay span:first-child {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.92);
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.35);
    font-size: 28px;
    padding-left: 4px;
}

.player-overlay span:last-child {
    font-size: 18px;
    font-weight: 900;
}

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

.player-message {
    position: absolute;
    left: 18px;
    bottom: 18px;
    right: 18px;
    z-index: 3;
    display: none;
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--white);
    background: rgba(15, 23, 42, 0.82);
}

.player-message.is-visible {
    display: block;
}

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

.story-card,
.meta-card {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-xl);
    background: var(--white);
    padding: 26px;
    box-shadow: var(--shadow-card);
}

.story-card p {
    margin: 0 0 16px;
    color: var(--slate-700);
    line-height: 1.9;
    font-size: 16px;
}

.meta-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.meta-list div {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 12px;
    align-items: start;
    border-bottom: 1px solid var(--slate-100);
    padding-bottom: 12px;
}

.meta-list dt {
    color: var(--slate-500);
    font-weight: 800;
}

.meta-list dd {
    margin: 0;
    color: var(--slate-900);
    line-height: 1.65;
}

.search-page {
    max-width: 980px;
    margin: 0 auto;
    padding: 62px 20px 0;
}

.search-panel {
    margin: 24px 0;
    padding: 12px;
    border: 1px solid var(--slate-200);
    border-radius: 999px;
    background: var(--white);
    box-shadow: var(--shadow-card);
}

.search-panel input {
    flex: 1;
    border: 0;
}

.search-results {
    display: grid;
    gap: 16px;
}

.search-result-card {
    display: grid;
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 16px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    padding: 12px;
    box-shadow: var(--shadow-card);
}

.search-result-card img {
    border-radius: 14px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: var(--slate-100);
}

.search-result-card h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 900;
}

.search-result-card p {
    margin: 0 0 12px;
    color: var(--slate-500);
    line-height: 1.65;
}

.empty-state {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    padding: 28px;
    color: var(--slate-500);
    text-align: center;
}

.site-footer {
    margin-top: 70px;
    background: var(--slate-900);
    color: rgba(255, 255, 255, 0.78);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 38px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-brand {
    color: var(--white);
    font-size: 22px;
}

.site-footer p {
    margin: 10px 0 0;
    line-height: 1.7;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.footer-links a {
    border-radius: 999px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.08);
}

.footer-links a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.16);
}

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

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

@media (max-width: 820px) {
    .header-inner {
        height: auto;
        min-height: 64px;
        flex-wrap: wrap;
        padding: 12px 16px;
    }

    .menu-button {
        display: inline-flex;
    }

    .nav-panel {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 8px 0 4px;
    }

    .nav-panel.is-open {
        display: flex;
    }

    .main-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .main-nav a {
        border-radius: 12px;
        padding: 10px 12px;
        background: var(--slate-100);
    }

    .top-search {
        align-items: stretch;
    }

    .top-search input {
        min-width: 0;
        flex: 1;
    }

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

    .hero-controls,
    .hero-dots {
        bottom: 22px;
    }

    .hero-search,
    .search-panel,
    .category-filter {
        border-radius: var(--radius-lg);
        flex-direction: column;
        align-items: stretch;
    }

    .hero-search input,
    .search-panel input,
    .category-filter input {
        min-width: 0;
        width: 100%;
    }

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

    .section-header,
    .footer-inner,
    .category-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .detail-inner {
        grid-template-columns: 1fr;
    }

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

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

    .ranking-item,
    .search-result-card {
        grid-template-columns: 86px minmax(0, 1fr);
    }

    .hero-copy h1,
    .hero-copy h2 {
        font-size: 38px;
    }

    .page-title,
    .detail-inner {
        padding: 46px 16px;
    }

    .page-section,
    .player-section,
    .detail-content,
    .related-section,
    .search-page {
        padding-left: 16px;
        padding-right: 16px;
    }
}
