:root {
    --color-bg: #f8fafc;
    --color-panel: #ffffff;
    --color-text: #111827;
    --color-muted: #64748b;
    --color-line: #e5e7eb;
    --color-blue: #2563eb;
    --color-blue-dark: #1d4ed8;
    --color-red: #dc2626;
    --color-orange: #f97316;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
    --radius-lg: 18px;
    --radius-md: 14px;
    --max-width: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
}

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

img,
video {
    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.94);
    border-bottom: 1px solid var(--color-line);
    backdrop-filter: blur(18px);
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.06);
}

.header-inner {
    max-width: var(--max-width);
    min-height: 68px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-mark,
.footer-logo span {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--color-red), var(--color-orange));
    box-shadow: 0 12px 24px rgba(220, 38, 38, 0.2);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-text strong {
    font-size: 20px;
    letter-spacing: 0.02em;
}

.brand-text small {
    margin-top: 3px;
    color: var(--color-muted);
    font-size: 12px;
}

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

.main-nav a,
.mobile-nav a {
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    transition: color 0.2s ease, background 0.2s ease;
}

.main-nav a:hover,
.mobile-nav a:hover {
    color: var(--color-blue);
    background: #eff6ff;
}

.top-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-search input,
.search-panel input,
.filter-bar input,
.search-panel select {
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 10px 14px;
    background: #fff;
    color: var(--color-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.top-search input {
    width: 190px;
}

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

.top-search button,
.search-panel button,
.btn-primary {
    border: 0;
    border-radius: 12px;
    padding: 10px 18px;
    color: #fff;
    background: var(--color-blue);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.top-search button:hover,
.search-panel button:hover,
.btn-primary:hover {
    background: var(--color-blue-dark);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
    transform: translateY(-1px);
}

.menu-button {
    display: none;
    border: 0;
    border-radius: 10px;
    width: 42px;
    height: 42px;
    background: #f1f5f9;
    color: #0f172a;
}

.mobile-nav {
    display: none;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px 16px;
    flex-direction: column;
}

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

.hero {
    position: relative;
    min-height: 560px;
    overflow: hidden;
    background: linear-gradient(120deg, #0f172a, #334155);
}

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

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: radial-gradient(circle at 20% 20%, #475569, #0f172a 64%);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.2)), linear-gradient(0deg, rgba(0, 0, 0, 0.78), transparent 48%);
}

.hero-content {
    position: absolute;
    left: 50%;
    bottom: 58px;
    width: min(var(--max-width), calc(100% - 40px));
    transform: translateX(-50%);
    color: #fff;
}

.hero-kicker,
.detail-kicker,
.page-hero span,
.card-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(90deg, var(--color-red), #db2777);
}

.hero h1 {
    max-width: 780px;
    margin: 18px 0 14px;
    font-size: clamp(36px, 6vw, 68px);
    line-height: 1.06;
    letter-spacing: -0.04em;
}

.hero p {
    max-width: 680px;
    color: #e5e7eb;
    font-size: 18px;
}

.hero-meta,
.detail-meta,
.card-meta,
.rank-info div {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    color: #e5e7eb;
}

.hero-meta span,
.detail-meta span,
.card-meta span,
.rank-info div span {
    border-radius: 999px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.14);
}

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

.btn-ghost,
.page-actions a,
.panel-link,
.text-link,
.section-more {
    border-radius: 12px;
    padding: 10px 16px;
    color: var(--color-blue);
    background: #eff6ff;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease;
}

.hero .btn-ghost {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
}

.btn-ghost:hover,
.page-actions a:hover,
.panel-link:hover,
.text-link:hover,
.section-more:hover {
    transform: translateY(-1px);
    background: #dbeafe;
}

.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    font-size: 34px;
    line-height: 1;
    backdrop-filter: blur(12px);
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

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

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

.content-section,
.page-main,
.detail-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 48px 20px;
}

.content-section + .content-section {
    padding-top: 18px;
}

.tinted-blue,
.tinted-amber {
    max-width: calc(var(--max-width) + 40px);
    border-radius: 28px;
    margin-top: 24px;
}

.tinted-blue {
    background: linear-gradient(135deg, #eff6ff, #ecfeff);
}

.tinted-amber {
    background: linear-gradient(135deg, #fff7ed, #fff1f2);
}

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

.section-head h2,
.rank-panel h2,
.footer-inner h2,
.detail-content h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
}

.section-head p {
    margin: 7px 0 0;
    color: var(--color-muted);
}

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    background: var(--color-panel);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-4px);
    border-color: #bfdbfe;
    box-shadow: var(--shadow-soft);
}

.card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    display: block;
    overflow: hidden;
    background: radial-gradient(circle at 30% 18%, #93c5fd, #0f172a 72%);
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease, opacity 0.2s ease;
}

.movie-card:hover .card-media img {
    transform: scale(1.05);
}

.card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.68), transparent 52%);
}

.card-badge {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 5px 10px;
    font-size: 12px;
}

.card-body {
    padding: 16px;
}

.card-title {
    display: -webkit-box;
    overflow: hidden;
    min-height: 50px;
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-title:hover {
    color: var(--color-blue);
}

.card-body p {
    display: -webkit-box;
    overflow: hidden;
    min-height: 46px;
    margin: 8px 0 0;
    color: var(--color-muted);
    font-size: 14px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-meta {
    margin-top: 12px;
    color: var(--color-muted);
    gap: 7px;
}

.card-meta span,
.rank-info div span {
    color: #475569;
    background: #f1f5f9;
    font-size: 12px;
}

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

.tag-row span,
.tag-row a {
    border-radius: 999px;
    padding: 4px 9px;
    color: #1d4ed8;
    background: #eff6ff;
    font-size: 12px;
    font-weight: 700;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
}

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

.movie-card-list {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
}

.movie-card-list .card-media {
    aspect-ratio: auto;
    height: 100%;
}

.movie-card-list .card-title {
    min-height: auto;
}

.rank-panel {
    position: sticky;
    top: 92px;
    align-self: start;
    padding: 22px;
    border: 1px solid var(--color-line);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.rank-panel h2 {
    margin-bottom: 16px;
}

.rank-item {
    display: grid;
    grid-template-columns: 42px 78px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #eef2f7;
}

.rank-num {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--color-orange), var(--color-red));
    font-weight: 900;
}

.rank-poster {
    width: 78px;
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e293b, #60a5fa);
}

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

.rank-info a {
    display: block;
    overflow: hidden;
    color: #0f172a;
    font-weight: 900;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rank-info p {
    display: -webkit-box;
    overflow: hidden;
    margin: 4px 0 0;
    color: var(--color-muted);
    font-size: 13px;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.rank-info div {
    margin-top: 7px;
    gap: 6px;
}

.panel-link {
    display: block;
    margin-top: 18px;
    text-align: center;
}

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

.category-card,
.category-overview-card {
    position: relative;
    overflow: hidden;
    min-height: 150px;
    border: 1px solid rgba(255, 255, 255, 0.74);
    border-radius: 22px;
    padding: 22px;
    background: #fff;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.category-card span,
.category-title-link span {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    color: #fff;
    background: linear-gradient(90deg, var(--color-blue), #06b6d4);
    font-size: 12px;
    font-weight: 900;
}

.category-card strong,
.category-title-link h2 {
    display: block;
    margin-top: 12px;
    font-size: 22px;
}

.category-card em {
    display: block;
    margin-top: 10px;
    color: var(--color-muted);
    font-style: normal;
}

.category-overview-card p {
    margin: 12px 0;
    color: var(--color-muted);
}

.category-overview-card ul {
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.category-overview-card li + li {
    margin-top: 8px;
}

.category-overview-card li a:hover {
    color: var(--color-blue);
}

.page-main {
    padding-top: 28px;
}

.page-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 56px;
    color: #fff;
    background: radial-gradient(circle at 20% 10%, rgba(96, 165, 250, 0.7), transparent 34%), linear-gradient(135deg, #0f172a, #334155);
    box-shadow: var(--shadow-soft);
}

.page-hero h1 {
    max-width: 780px;
    margin: 16px 0 12px;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.08;
}

.page-hero p {
    max-width: 720px;
    margin: 0;
    color: #e5e7eb;
    font-size: 17px;
}

.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}

.filter-bar input {
    width: min(380px, 100%);
}

.filter-bar span {
    color: var(--color-muted);
    font-weight: 700;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 34px;
}

.pagination a,
.pagination span {
    min-width: 42px;
    border-radius: 12px;
    padding: 9px 12px;
    text-align: center;
    background: #fff;
    color: #334155;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.pagination .current {
    color: #fff;
    background: var(--color-blue);
}

.ranking-list .rank-item {
    grid-template-columns: 60px 150px minmax(0, 1fr);
    padding: 18px;
    margin-bottom: 12px;
    border: 1px solid var(--color-line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.ranking-list .rank-poster {
    width: 150px;
}

.search-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px auto;
    gap: 12px;
    margin-bottom: 24px;
    padding: 18px;
    border: 1px solid var(--color-line);
    border-radius: 22px;
    background: #fff;
}

.detail-main {
    padding-top: 26px;
}

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

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

.detail-hero {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 34px;
    align-items: end;
    overflow: hidden;
    border-radius: 30px;
    padding: 36px;
    color: #fff;
    background: radial-gradient(circle at 12% 8%, rgba(239, 68, 68, 0.7), transparent 32%), linear-gradient(135deg, #020617, #1e293b 58%, #0f172a);
    box-shadow: var(--shadow-soft);
}

.detail-poster {
    overflow: hidden;
    border-radius: 24px;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #1d4ed8, #0f172a);
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.35);
}

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

.detail-info h1 {
    margin: 16px 0 12px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.08;
}

.detail-line {
    max-width: 760px;
    color: #e5e7eb;
    font-size: 18px;
}

.detail-meta span {
    color: #f8fafc;
}

.detail-tags a {
    color: #dbeafe;
    background: rgba(37, 99, 235, 0.34);
}

.player-section {
    margin-top: 28px;
}

.video-box {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    aspect-ratio: 16 / 9;
    background: #020617;
    box-shadow: var(--shadow-soft);
}

.stream-player {
    width: 100%;
    height: 100%;
    background: #000;
}

.video-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 88px;
    height: 88px;
    border: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(37, 99, 235, 0.88);
    font-size: 36px;
    transform: translate(-50%, -50%);
    box-shadow: 0 18px 45px rgba(37, 99, 235, 0.35);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.video-play:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.video-box.is-playing .video-play {
    opacity: 0;
    pointer-events: none;
}

.detail-content {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
    gap: 24px;
    margin-top: 28px;
}

.detail-content article {
    padding: 26px;
    border: 1px solid var(--color-line);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.detail-content p {
    margin: 12px 0 0;
    color: #475569;
    font-size: 16px;
}

.site-footer {
    margin-top: 40px;
    color: #cbd5e1;
    background: #0f172a;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 46px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 1fr 1fr;
    gap: 38px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 20px;
}

.footer-brand p {
    max-width: 410px;
    color: #94a3b8;
}

.footer-inner h2 {
    margin-bottom: 14px;
    color: #fff;
    font-size: 18px;
}

.footer-inner ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-inner li + li {
    margin-top: 9px;
}

.footer-inner a:hover {
    color: #60a5fa;
}

.footer-bottom {
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    padding: 18px 20px;
    text-align: center;
    color: #94a3b8;
}

@media (max-width: 1040px) {
    .main-nav,
    .top-search {
        display: none;
    }

    .menu-button {
        display: block;
        margin-left: auto;
    }

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

    .two-column,
    .detail-content {
        grid-template-columns: 1fr;
    }

    .rank-panel {
        position: static;
    }

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

@media (max-width: 760px) {
    .brand-text small {
        display: none;
    }

    .hero {
        min-height: 520px;
    }

    .hero-content {
        bottom: 54px;
    }

    .hero-arrow {
        display: none;
    }

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

    .movie-card-list {
        grid-template-columns: 130px minmax(0, 1fr);
    }

    .card-body {
        padding: 13px;
    }

    .card-title {
        min-height: auto;
        font-size: 16px;
    }

    .section-head,
    .filter-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-hero,
    .detail-hero {
        border-radius: 22px;
        padding: 30px 22px;
    }

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

    .ranking-list .rank-item {
        grid-template-columns: 42px 92px minmax(0, 1fr);
    }

    .ranking-list .rank-poster {
        width: 92px;
    }

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

@media (max-width: 520px) {
    .header-inner {
        min-height: 62px;
        padding: 0 14px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
    }

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

    .content-section,
    .page-main,
    .detail-main {
        padding-left: 14px;
        padding-right: 14px;
    }

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

    .movie-card-list {
        grid-template-columns: 1fr;
    }

    .movie-card-list .card-media {
        aspect-ratio: 16 / 10;
    }

    .hero h1,
    .detail-info h1,
    .page-hero h1 {
        font-size: 34px;
    }
}
