* {
    box-sizing: border-box;
}

:root {
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --cyan: #0891b2;
    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --white: #ffffff;
    --amber: #f59e0b;
    --rose: #ef4444;
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.14);
    --soft-shadow: 0 12px 30px rgba(37, 99, 235, 0.12);
    --radius-xl: 18px;
    --radius-2xl: 28px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 48%, #f1f5f9 100%);
    color: var(--slate-800);
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    color: var(--white);
    background: linear-gradient(90deg, var(--blue) 0%, var(--blue-dark) 48%, var(--cyan) 100%);
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.24);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 18px 0;
}

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

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.brand strong {
    display: block;
    font-size: 22px;
    letter-spacing: 0.02em;
}

.brand em {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    font-style: normal;
    font-weight: 500;
}

.main-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.main-nav a {
    padding: 9px 13px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.25s ease, transform 0.25s ease;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    color: var(--white);
    background: rgba(255, 255, 255, 0.16);
}

.hero {
    position: relative;
    overflow: hidden;
    color: var(--white);
    background: radial-gradient(circle at 15% 10%, rgba(37, 99, 235, 0.42), transparent 32%),
        linear-gradient(180deg, var(--slate-950) 0%, var(--slate-900) 100%);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.18;
    background-image: radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.45) 1px, transparent 0);
    background-size: 34px 34px;
}

.hero-inner {
    position: relative;
    z-index: 1;
    padding: 64px 0 72px;
}

.hero-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #fbbf24;
    background: rgba(255, 255, 255, 0.08);
}

.hero-title-row h2,
.section-title h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 900;
    letter-spacing: -0.03em;
}

.hero-slider {
    position: relative;
}

.hero-slide {
    display: none;
    grid-template-columns: minmax(260px, 0.92fr) minmax(280px, 1.08fr);
    gap: 42px;
    align-items: center;
}

.hero-slide.is-active {
    display: grid;
}

.hero-poster {
    position: relative;
    height: min(56vw, 440px);
    min-height: 330px;
    overflow: hidden;
    border-radius: var(--radius-2xl);
    box-shadow: 0 34px 80px rgba(0, 0, 0, 0.34);
}

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

.hero-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.06) 72%);
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.badge-row,
.movie-tags,
.detail-tags,
.category-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.badge-row span,
.movie-tags span,
.detail-tags span,
.category-chips a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.badge-row span {
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
}

.badge-row span:first-child,
.movie-tags span:first-child,
.detail-tags span:first-child {
    color: var(--white);
    background: var(--blue);
}

.hero-content h1,
.hero-content h3 {
    margin: 0;
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.hero-content p {
    max-width: 680px;
    margin: 0;
    color: #cbd5e1;
    font-size: 18px;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border: 0;
    border-radius: 14px;
    font-weight: 800;
    color: var(--white);
    background: var(--blue);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.btn:hover {
    transform: translateY(-2px);
    background: var(--blue-dark);
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.34);
}

.btn-light {
    color: var(--slate-800);
    background: var(--white);
    box-shadow: 0 12px 28px rgba(255, 255, 255, 0.12);
}

.btn-ghost {
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.hero-dot {
    width: 34px;
    height: 5px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
    transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.is-active {
    width: 58px;
    background: var(--blue);
}

.hero-search {
    margin-top: 36px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(18px);
}

.search-input {
    flex: 1 1 300px;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    outline: none;
    color: var(--slate-800);
    background: var(--white);
}

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

.category-chips {
    margin-top: 14px;
}

.category-chips a {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

.section {
    padding: 58px 0;
}

.section-soft {
    background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 100%);
}

.section-dark {
    color: var(--white);
    background: linear-gradient(135deg, var(--slate-800) 0%, var(--slate-950) 100%);
}

.section-card {
    margin: 58px auto;
    padding: 34px;
    border-radius: var(--radius-2xl);
    background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
    box-shadow: var(--soft-shadow);
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
}

.section-title h2,
.page-head h1,
.detail-title h1 {
    margin: 0;
    color: var(--slate-800);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.section-dark .section-title h2,
.section-dark .section-title p {
    color: var(--white);
}

.section-title p,
.page-head p,
.detail-title p {
    margin: 8px 0 0;
    color: var(--slate-600);
}

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

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

.movie-card {
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: var(--white);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

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

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

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

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

.play-mark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    font-size: 32px;
    opacity: 0;
    background: rgba(0, 0, 0, 0.34);
    transition: opacity 0.25s ease;
}

.play-mark::before {
    content: "";
    position: absolute;
    width: 72px;
    height: 72px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    z-index: -1;
}

.movie-card:hover .play-mark {
    opacity: 1;
}

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

.movie-tags span {
    color: var(--blue);
    background: #dbeafe;
}

.movie-card h3 {
    margin: 12px 0 8px;
    color: var(--slate-800);
    font-size: 18px;
    line-height: 1.28;
}

.movie-card h3 a:hover {
    color: var(--blue);
}

.movie-card p {
    display: -webkit-box;
    min-height: 47px;
    margin: 0 0 12px;
    overflow: hidden;
    color: var(--slate-600);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--slate-500);
    font-size: 13px;
}

.movie-card-horizontal {
    display: grid;
    grid-template-columns: 160px 1fr;
}

.movie-card-horizontal .poster-link {
    aspect-ratio: auto;
    min-height: 210px;
}

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

.category-card {
    min-height: 180px;
    padding: 24px;
    border-radius: var(--radius-xl);
    color: var(--white);
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: var(--soft-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

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

.category-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
}

.page-head {
    padding: 54px 0 30px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--slate-500);
    font-size: 14px;
}

.breadcrumbs a {
    color: var(--blue);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 36px 0 6px;
}

.pagination a,
.pagination strong,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.pagination strong {
    color: var(--white);
    background: var(--blue);
}

.rank-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
    align-items: start;
}

.rank-panel {
    padding: 24px;
    border-radius: var(--radius-2xl);
    background: var(--white);
    box-shadow: var(--soft-shadow);
}

.rank-panel h2 {
    margin: 0 0 18px;
    color: var(--slate-800);
}

.rank-row {
    display: grid;
    grid-template-columns: auto 72px 1fr;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border-radius: 16px;
    transition: background 0.22s ease, transform 0.22s ease;
}

.rank-row:hover {
    background: #eff6ff;
    transform: translateX(4px);
}

.rank-row img {
    width: 72px;
    height: 96px;
    border-radius: 12px;
    object-fit: cover;
}

.rank-row strong,
.rank-row em {
    display: block;
}

.rank-row strong {
    color: var(--slate-800);
}

.rank-row em {
    margin-top: 4px;
    color: var(--slate-500);
    font-style: normal;
    font-size: 13px;
}

.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    color: var(--white);
    font-weight: 900;
    background: var(--rose);
}

.detail-hero {
    padding: 42px 0 54px;
    color: var(--white);
    background: radial-gradient(circle at 78% 0%, rgba(8, 145, 178, 0.26), transparent 34%),
        linear-gradient(135deg, var(--slate-950), var(--slate-800));
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(320px, 1.35fr) minmax(260px, 0.65fr);
    gap: 30px;
    align-items: start;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-2xl);
    background: #000;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.3);
}

.player-shell video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-cover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: var(--white);
    background: rgba(2, 6, 23, 0.34);
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.player-cover span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 86px;
    height: 86px;
    border-radius: 999px;
    font-size: 32px;
    color: var(--blue);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.detail-title {
    padding: 4px 0 0;
}

.detail-title h1 {
    color: var(--white);
}

.detail-title p {
    color: #cbd5e1;
    font-size: 17px;
}

.detail-tags {
    margin: 18px 0;
}

.detail-tags span {
    color: #dbeafe;
    background: rgba(255, 255, 255, 0.1);
}

.detail-stat {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.detail-stat div {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
}

.detail-stat span,
.detail-stat strong {
    display: block;
}

.detail-stat span {
    color: #cbd5e1;
    font-size: 13px;
}

.detail-stat strong {
    margin-top: 4px;
    font-size: 19px;
}

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    padding: 42px 0 58px;
    align-items: start;
}

.article-box,
.sidebar-box {
    padding: 28px;
    border-radius: var(--radius-2xl);
    background: var(--white);
    box-shadow: var(--soft-shadow);
}

.article-box h2,
.sidebar-box h2 {
    margin: 0 0 16px;
    color: var(--slate-800);
    font-size: 24px;
}

.article-box p {
    margin: 0 0 18px;
    color: var(--slate-700);
    font-size: 16px;
    white-space: pre-line;
}

.search-panel {
    padding: 28px;
    border-radius: var(--radius-2xl);
    background: var(--white);
    box-shadow: var(--soft-shadow);
}

.search-controls {
    display: grid;
    grid-template-columns: 1fr 160px 160px auto;
    gap: 12px;
    margin-bottom: 24px;
}

.search-controls select {
    min-height: 48px;
    padding: 0 12px;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    background: var(--white);
}

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

.empty-state {
    padding: 34px;
    border-radius: var(--radius-xl);
    color: var(--slate-600);
    background: #f8fafc;
    text-align: center;
}

.site-footer {
    color: #cbd5e1;
    background: var(--slate-950);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 28px;
    padding: 48px 0 26px;
}

.footer-grid h3 {
    margin: 0 0 12px;
    color: #60a5fa;
}

.footer-grid a {
    display: block;
    margin: 8px 0;
    color: #cbd5e1;
}

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

.footer-grid p {
    max-width: 420px;
    color: #94a3b8;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 0 32px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    color: #94a3b8;
}

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

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

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

@media (max-width: 860px) {
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .main-nav {
        display: none;
        width: 100%;
        justify-content: flex-start;
        padding-top: 14px;
    }

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

    .header-inner {
        flex-wrap: wrap;
    }

    .hero-slide,
    .detail-layout,
    .content-layout,
    .rank-layout {
        grid-template-columns: 1fr;
    }

    .hero-poster {
        height: 360px;
    }

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

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

    .search-controls {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 560px) {
    .container {
        width: min(100% - 22px, 1180px);
    }

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

    .brand em {
        display: none;
    }

    .hero-inner {
        padding: 42px 0 50px;
    }

    .hero-poster {
        min-height: 280px;
        height: 320px;
    }

    .movie-grid,
    .movie-grid.compact,
    .search-results,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .movie-card-horizontal {
        grid-template-columns: 118px 1fr;
    }

    .movie-card-horizontal .poster-link {
        min-height: 168px;
    }

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

    .section-card,
    .article-box,
    .sidebar-box,
    .rank-panel,
    .search-panel {
        padding: 20px;
    }

    .footer-grid,
    .footer-bottom {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
}
