:root {
    --color-bg: #f8fbff;
    --color-surface: #ffffff;
    --color-text: #111827;
    --color-muted: #64748b;
    --color-soft: #e0f2fe;
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-accent: #06b6d4;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.10);
    --shadow-card: 0 12px 30px rgba(37, 99, 235, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --max-width: 1240px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--color-text);
    background: linear-gradient(135deg, #f8fbff 0%, #eff6ff 45%, #f0fdff 100%);
    font-family: -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;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.header-inner {
    width: min(var(--max-width), calc(100% - 32px));
    min-height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

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

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.32);
}

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

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

.nav-link,
.mobile-nav-link {
    color: #334155;
    padding: 10px 15px;
    border-radius: 999px;
    font-weight: 700;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-nav-link:hover,
.mobile-nav-link.is-active {
    color: var(--color-primary);
    background: #dbeafe;
}

.nav-link:hover {
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #eff6ff;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    background: #1e293b;
    border-radius: 99px;
}

.mobile-nav {
    display: none;
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto 14px;
    padding: 10px;
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.mobile-nav.is-open {
    display: grid;
    gap: 6px;
}

.hero-carousel {
    position: relative;
    overflow: hidden;
    min-height: 610px;
    color: #fff;
    background: radial-gradient(circle at 20% 20%, rgba(6, 182, 212, 0.38), transparent 34%), linear-gradient(135deg, #0f172a, #1d4ed8 50%, #0891b2);
}

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

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

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

.hero-backdrop {
    position: absolute;
    inset: 0;
    opacity: 0.32;
    filter: blur(8px) saturate(1.15);
    transform: scale(1.06);
}

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

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.58), rgba(15, 23, 42, 0.20));
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(var(--max-width), calc(100% - 32px));
    min-height: 610px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 1240px;
    padding: 96px 410px 96px 0;
}

.hero-kicker,
.section-kicker {
    margin: 0 0 10px;
    color: var(--color-primary);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-kicker {
    color: #bfdbfe;
}

.hero-content h1 {
    margin: 0;
    font-size: clamp(42px, 7vw, 78px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero-summary {
    max-width: 690px;
    margin: 24px 0 32px;
    color: #dbeafe;
    font-size: 18px;
}

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

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

.primary-button,
.quick-search button {
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
}

.ghost-button {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
}

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

.hero-poster {
    position: absolute;
    z-index: 3;
    right: max(24px, calc((100vw - var(--max-width)) / 2));
    top: 50%;
    width: min(330px, 28vw);
    aspect-ratio: 3 / 4.25;
    transform: translateY(-50%);
    overflow: hidden;
    border-radius: 34px;
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
}

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

.hero-poster span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(37, 99, 235, 0.86);
    border-radius: 999px;
    transform: translate(-50%, -50%);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.4);
}

.hero-controls {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: 34px;
    display: flex;
    align-items: center;
    gap: 14px;
    transform: translateX(-50%);
}

.hero-arrow,
.hero-dot {
    border: 0;
    cursor: pointer;
}

.hero-arrow {
    width: 40px;
    height: 40px;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    font-size: 30px;
    line-height: 1;
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    background: rgba(255, 255, 255, 0.44);
    border-radius: 99px;
    transition: width 0.2s ease, background 0.2s ease;
}

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

.search-panel,
.page-shell {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto;
}

.search-panel {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
    margin-top: -62px;
    padding: 28px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(37, 99, 235, 0.10);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.search-panel h2,
.section-heading h2,
.page-hero h1,
.detail-info h1,
.detail-text h2,
.footer-links h2 {
    margin: 0;
}

.quick-search {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quick-search input,
.filter-toolbar input,
.filter-toolbar select {
    width: 100%;
    height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 0 16px;
    color: #0f172a;
    background: #fff;
    outline: none;
}

.quick-search input:focus,
.filter-toolbar input:focus,
.filter-toolbar select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.quick-categories {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-categories a,
.detail-meta span,
.detail-meta a,
.detail-tags span,
.movie-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 11px;
    color: var(--color-primary-dark);
    background: #dbeafe;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.page-shell {
    padding: 62px 0 80px;
}

.page-top-space {
    padding-top: 40px;
}

.content-section {
    margin-bottom: 70px;
}

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

.section-heading h2 {
    color: #0f172a;
    font-size: clamp(24px, 4vw, 34px);
    letter-spacing: -0.03em;
}

.section-more {
    color: var(--color-primary);
    font-weight: 800;
}

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

.movie-card {
    display: block;
    overflow: hidden;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 22px 45px rgba(37, 99, 235, 0.18);
}

.movie-poster {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4.25;
    background: linear-gradient(135deg, #dbeafe, #f0fdff);
}

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

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

.poster-play {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(37, 99, 235, 0.88);
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.rank-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    min-width: 38px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #f97316, #ef4444);
    border-radius: 999px;
    font-weight: 900;
}

.movie-info {
    padding: 15px;
}

.movie-info h3 {
    height: 48px;
    margin: 0 0 8px;
    overflow: hidden;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.45;
}

.movie-meta,
.movie-line {
    margin: 0;
    color: var(--color-muted);
    font-size: 13px;
}

.movie-line {
    height: 42px;
    margin-top: 8px;
    overflow: hidden;
}

.movie-tags,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

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

.category-card,
.category-overview-card,
.page-hero,
.detail-text,
.player-panel,
.detail-main,
.ranking-list {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}

.category-card,
.category-overview-card {
    padding: 24px;
}

.category-card-main,
.category-overview-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #0f172a;
    font-size: 22px;
    font-weight: 900;
}

.category-card-main strong,
.category-overview-title strong {
    color: var(--color-primary);
    font-size: 15px;
}

.category-card p,
.category-overview-card p {
    color: var(--color-muted);
}

.compact-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.compact-link {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #1e293b;
    font-size: 13px;
    font-weight: 700;
}

.compact-link img {
    width: 42px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
}

.compact-link span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-list {
    overflow: hidden;
}

.ranking-row {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s ease;
}

.ranking-row:last-child {
    border-bottom: 0;
}

.ranking-row:hover {
    background: #eff6ff;
}

.ranking-number {
    color: var(--color-primary);
    font-size: 24px;
    font-weight: 900;
}

.ranking-title {
    color: #0f172a;
    font-weight: 800;
}

.ranking-meta {
    color: var(--color-muted);
    font-size: 14px;
}

.page-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 36px;
    padding: 48px;
    color: #fff;
    background: radial-gradient(circle at 84% 10%, rgba(34, 211, 238, 0.5), transparent 36%), linear-gradient(135deg, #1d4ed8, #0f172a);
}

.page-hero .section-kicker,
.page-hero p {
    color: #dbeafe;
}

.page-hero h1 {
    color: #fff;
    font-size: clamp(36px, 6vw, 58px);
    line-height: 1.1;
}

.page-hero p:last-child {
    max-width: 760px;
    margin-bottom: 0;
}

.filter-toolbar {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
    padding: 18px;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: var(--radius-lg);
}

.filter-toolbar label {
    display: grid;
    gap: 7px;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.filter-empty {
    padding: 32px;
    text-align: center;
    color: var(--color-muted);
    background: #fff;
    border-radius: var(--radius-lg);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 22px;
    color: var(--color-muted);
    font-size: 14px;
}

.breadcrumb a {
    color: var(--color-primary);
    font-weight: 800;
}

.detail-layout {
    display: grid;
    gap: 28px;
}

.player-panel {
    padding: 16px;
}

.video-frame {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #020617;
    border-radius: 24px;
}

.movie-video {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    background: #020617;
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    border: 0;
    color: #fff;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.25), rgba(2, 6, 23, 0.78));
    cursor: pointer;
    transition: opacity 0.25s ease;
}

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

.player-icon {
    width: 86px;
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    border-radius: 999px;
    box-shadow: 0 20px 45px rgba(37, 99, 235, 0.45);
    font-size: 34px;
}

.player-overlay strong {
    max-width: min(720px, 80%);
    font-size: clamp(22px, 4vw, 40px);
    text-align: center;
}

.detail-main {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 28px;
    padding: 24px;
}

.detail-poster {
    overflow: hidden;
    border-radius: 22px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
}

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

.detail-info h1 {
    color: #0f172a;
    font-size: clamp(32px, 5vw, 54px);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.detail-one-line {
    color: #334155;
    font-size: 18px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.detail-text {
    padding: 32px;
}

.detail-text h2 {
    margin-top: 0;
    color: #0f172a;
    font-size: 26px;
}

.detail-text h2:not(:first-child) {
    margin-top: 28px;
}

.detail-text p {
    color: #334155;
    font-size: 17px;
}

.related-section {
    margin-bottom: 0;
}

.site-footer {
    color: #cbd5e1;
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

.footer-inner {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
    padding: 52px 0;
}

.footer-about p {
    max-width: 520px;
    color: #94a3b8;
}

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

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

.footer-links h2 {
    color: #fff;
    font-size: 17px;
}

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

.footer-bottom {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.footer-bottom p {
    margin: 0;
}

.back-to-top {
    border: 0;
    color: #e2e8f0;
    background: transparent;
    cursor: pointer;
}

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

    .hero-content {
        padding-right: 330px;
    }

    .hero-poster {
        width: 280px;
    }
}

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

    .menu-toggle {
        display: block;
    }

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

    .hero-content {
        justify-content: flex-end;
        padding: 84px 0 260px;
    }

    .hero-slide::after {
        background: linear-gradient(180deg, rgba(15, 23, 42, 0.52), rgba(15, 23, 42, 0.96));
    }

    .hero-poster {
        left: 50%;
        right: auto;
        top: auto;
        bottom: 78px;
        width: 210px;
        transform: translateX(-50%);
        border-radius: 24px;
    }

    .search-panel,
    .filter-toolbar,
    .detail-main,
    .footer-inner {
        grid-template-columns: 1fr;
    }

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

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

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 620px) {
    .header-inner,
    .search-panel,
    .page-shell,
    .footer-inner,
    .footer-bottom,
    .mobile-nav {
        width: min(100% - 22px, var(--max-width));
    }

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

    .hero-content h1 {
        font-size: 38px;
    }

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

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

    .search-panel,
    .page-hero,
    .detail-text,
    .detail-main,
    .category-card,
    .category-overview-card {
        padding: 22px;
        border-radius: 22px;
    }

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

    .movie-info {
        padding: 12px;
    }

    .movie-line {
        display: none;
    }

    .ranking-row {
        grid-template-columns: 44px 1fr;
    }

    .ranking-meta {
        grid-column: 2;
    }

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

    .player-panel {
        padding: 8px;
        border-radius: 18px;
    }

    .video-frame {
        border-radius: 16px;
    }
}
