:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #111827;
    --muted: #64748b;
    --line: #e5e7eb;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --green: #16a34a;
    --red: #dc2626;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --soft-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 48%, #f8fafc 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    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: 50;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(18px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

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

.brand-icon {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 12px;
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.28);
}

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

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

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

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

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

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

.mobile-nav {
    display: none;
    padding: 10px 16px 18px;
    border-top: 1px solid var(--line);
    background: #ffffff;
}

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

.hero {
    position: relative;
    height: 72vh;
    min-height: 560px;
    overflow: hidden;
    background: #020617;
}

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

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

.hero-slide > img,
.detail-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 70% 25%, rgba(59, 130, 246, 0.45), transparent 34%),
        linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.68) 46%, rgba(2, 6, 23, 0.1) 100%),
        linear-gradient(0deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.16) 55%, rgba(2, 6, 23, 0.45) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding-bottom: 98px;
    color: #ffffff;
}

.hero-tags,
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-tags span,
.tag-cloud span {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.hero-tags span {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(14px);
}

.hero-content h1 {
    max-width: 830px;
    margin: 18px 0 16px;
    font-size: clamp(38px, 6vw, 76px);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.hero-content p {
    max-width: 720px;
    margin: 0 0 22px;
    color: #e2e8f0;
    font-size: clamp(17px, 2vw, 22px);
}

.hero-meta,
.detail-meta,
.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.hero-meta span,
.detail-meta span {
    padding: 7px 12px;
    color: #dbeafe;
    background: rgba(37, 99, 235, 0.28);
    border: 1px solid rgba(147, 197, 253, 0.32);
    border-radius: 10px;
    font-weight: 700;
}

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

.primary-button,
.ghost-button,
.quick-search button,
.back-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    border: 0;
    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: #ffffff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.32);
}

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

.ghost-button {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(14px);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 48px;
    height: 48px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.hero-arrow.prev {
    left: 22px;
}

.hero-arrow.next {
    right: 22px;
}

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 36px;
    z-index: 3;
    display: flex;
    gap: 9px;
    transform: translateX(-50%);
}

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

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

.intro-search,
.page-section {
    padding: 64px 0 0;
}

.intro-search {
    display: grid;
    grid-template-columns: 1fr minmax(310px, 420px);
    gap: 32px;
    align-items: center;
}

.kicker {
    display: inline-flex;
    margin-bottom: 10px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.intro-search h2,
.section-head h2,
.page-hero h1,
.detail-intro h1 {
    margin: 0;
    line-height: 1.12;
    letter-spacing: -0.04em;
}

.intro-search h2,
.section-head h2,
.page-hero h1 {
    font-size: clamp(30px, 4vw, 46px);
}

.intro-search p,
.section-head p,
.page-hero p,
.channel-card p,
.category-card p {
    color: var(--muted);
}

.quick-search {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--soft-shadow);
}

.quick-search input,
.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 44px;
    padding: 0 16px;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    outline: 0;
}

.quick-search input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

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

.section-head a {
    color: var(--blue);
    font-weight: 900;
}

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

.library-grid {
    grid-template-columns: repeat(5, 1fr);
}

.movie-card {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
    border-color: rgba(59, 130, 246, 0.38);
    box-shadow: var(--shadow);
    transform: translateY(-6px);
}

.poster {
    position: relative;
    display: block;
    height: 280px;
    overflow: hidden;
    background: #0f172a;
}

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

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

.poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 38%, rgba(2, 6, 23, 0.72) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.movie-card:hover .poster::after {
    opacity: 1;
}

.poster-type,
.rank-mark,
.poster-play {
    position: absolute;
    z-index: 2;
}

.poster-type {
    top: 12px;
    right: 12px;
    padding: 5px 10px;
    color: #ffffff;
    background: rgba(37, 99, 235, 0.86);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.rank-mark {
    top: 12px;
    left: 12px;
    display: grid;
    min-width: 34px;
    height: 34px;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(135deg, #ef4444, #f97316);
    border-radius: 999px;
    font-weight: 900;
}

.poster-play {
    left: 50%;
    top: 50%;
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.86);
    backdrop-filter: blur(14px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .poster-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.card-content {
    padding: 16px;
}

.card-content h2,
.card-content h3 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.35;
}

.card-content h2 a:hover,
.card-content h3 a:hover {
    color: var(--blue);
}

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

.card-meta {
    color: #64748b;
    font-size: 13px;
}

.card-meta span:not(:last-child)::after {
    content: "·";
    margin-left: 10px;
    color: #cbd5e1;
}

.horizontal {
    display: grid;
    grid-template-columns: 190px 1fr;
}

.horizontal-poster {
    height: 132px;
}

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

.ranking-grid {
    grid-template-columns: repeat(2, 1fr);
}

.category-grid,
.channel-grid {
    display: grid;
    gap: 24px;
}

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

.channel-grid {
    grid-template-columns: repeat(2, 1fr);
}

.category-card,
.channel-card {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.category-card a,
.channel-card a {
    display: block;
    padding: 18px;
}

.category-covers,
.channel-thumbs {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

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

.channel-thumbs {
    grid-template-columns: repeat(4, 1fr);
}

.category-covers img,
.channel-thumbs img {
    width: 100%;
    height: 96px;
    object-fit: cover;
    border-radius: 14px;
}

.channel-card h2,
.category-card h3 {
    margin: 0 0 8px;
}

.channel-card span {
    color: var(--blue);
    font-weight: 900;
}

.page-hero,
.detail-hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background:
        radial-gradient(circle at 78% 18%, rgba(124, 58, 237, 0.38), transparent 32%),
        linear-gradient(135deg, #020617, #1e3a8a 52%, #0f172a);
}

.small-hero {
    padding: 82px 0;
}

.library-hero {
    background:
        radial-gradient(circle at 80% 20%, rgba(37, 99, 235, 0.45), transparent 32%),
        linear-gradient(135deg, #020617, #172554 56%, #111827);
}

.ranking-hero {
    background:
        radial-gradient(circle at 75% 20%, rgba(239, 68, 68, 0.42), transparent 32%),
        linear-gradient(135deg, #020617, #7f1d1d 54%, #111827);
}

.page-hero p {
    max-width: 720px;
    color: #dbeafe;
    font-size: 18px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    margin-bottom: 18px;
    color: #dbeafe;
    font-weight: 700;
}

.breadcrumb a:hover {
    color: #ffffff;
}

.filter-panel {
    display: grid;
    grid-template-columns: 1fr 180px 180px;
    gap: 14px;
    align-items: end;
    margin-bottom: 28px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--soft-shadow);
}

.filter-panel label {
    display: grid;
    gap: 8px;
}

.filter-panel span {
    color: #475569;
    font-size: 13px;
    font-weight: 900;
}

.detail-hero {
    min-height: 540px;
}

.detail-bg {
    position: absolute;
    inset: 0;
    opacity: 0.32;
    filter: blur(2px);
}

.detail-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.72) 52%, rgba(2, 6, 23, 0.88)),
        linear-gradient(0deg, rgba(2, 6, 23, 0.98), transparent 70%);
}

.detail-hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 34px;
    align-items: end;
    min-height: 540px;
    padding: 72px 0 64px;
}

.detail-poster {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.36);
}

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

.detail-intro h1 {
    max-width: 850px;
    margin-top: 18px;
    color: #ffffff;
    font-size: clamp(34px, 5vw, 64px);
}

.detail-intro p {
    max-width: 850px;
    color: #e2e8f0;
    font-size: 18px;
}

.watch-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 26px;
    padding-top: 40px;
}

.watch-main {
    display: grid;
    gap: 24px;
}

.player-card,
.detail-card,
.side-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--soft-shadow);
}

.player-card {
    overflow: hidden;
}

.player-box {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #020617;
}

.movie-player,
.player-cover,
.player-cover img {
    width: 100%;
    height: 100%;
}

.movie-player {
    display: block;
    background: #020617;
}

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #020617;
    cursor: pointer;
    z-index: 2;
}

.player-cover img {
    position: absolute;
    inset: 0;
    object-fit: cover;
    opacity: 0.62;
    transform: scale(1.02);
}

.player-cover.is-hidden {
    display: none;
}

.play-orb {
    position: relative;
    z-index: 3;
    display: grid;
    width: 92px;
    height: 92px;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 50%;
    font-size: 34px;
    box-shadow: 0 22px 48px rgba(37, 99, 235, 0.42);
}

.detail-card,
.side-card {
    padding: 26px;
}

.detail-card h2,
.side-card h2 {
    margin: 0 0 14px;
    font-size: 24px;
}

.detail-card p {
    color: #334155;
    font-size: 16px;
}

.tag-cloud {
    margin-top: 20px;
}

.tag-cloud span {
    color: var(--blue);
    background: #eff6ff;
}

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

.side-links a {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 12px;
    align-items: center;
    font-weight: 800;
}

.side-links img {
    width: 82px;
    height: 60px;
    object-fit: cover;
    border-radius: 12px;
}

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

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

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

.site-footer h2 {
    margin: 0 0 12px;
    color: #ffffff;
    font-size: 18px;
}

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

.site-footer li + li {
    margin-top: 8px;
}

.site-footer a:hover {
    color: #93c5fd;
}

.footer-brand {
    margin-bottom: 12px;
    color: #ffffff;
    font-size: 20px;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.back-top {
    min-height: 40px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

[hidden] {
    display: none !important;
}

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

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

    .watch-layout {
        grid-template-columns: 1fr;
    }
}

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

    .menu-button {
        display: block;
    }

    .brand-name {
        font-size: 16px;
    }

    .hero {
        min-height: 620px;
    }

    .hero-content {
        padding-bottom: 92px;
    }

    .hero-arrow {
        display: none;
    }

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

    .quick-search {
        border-radius: 22px;
        flex-direction: column;
    }

    .movie-grid,
    .library-grid,
    .ranking-grid,
    .category-grid,
    .channel-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .horizontal {
        grid-template-columns: 130px 1fr;
    }

    .horizontal-poster {
        height: 118px;
    }

    .detail-hero-inner {
        align-items: start;
    }

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

    .detail-poster img {
        height: 310px;
    }

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

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

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

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

    .poster {
        height: 330px;
    }

    .horizontal {
        grid-template-columns: 112px 1fr;
    }

    .horizontal .card-content {
        padding: 12px;
    }

    .card-content h2 {
        font-size: 16px;
    }

    .detail-card,
    .side-card {
        padding: 20px;
    }

    .play-orb {
        width: 76px;
        height: 76px;
    }
}
