* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: #0f172a;
    --panel-strong: #111827;
    --line: rgba(59, 130, 246, 0.28);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --cyan: #06b6d4;
    --blue: #2563eb;
    --amber: #f59e0b;
    --shadow: 0 24px 70px rgba(2, 6, 23, 0.46);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.16), transparent 34rem),
        linear-gradient(180deg, #020617 0%, #0f172a 50%, #020617 100%);
    color: var(--text);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

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: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.92), rgba(15, 23, 42, 0.96));
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.34);
    backdrop-filter: blur(16px);
}

.header-inner {
    width: min(1180px, calc(100% - 32px));
    height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

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

.brand-mark,
.footer-brand span {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    box-shadow: 0 10px 26px rgba(6, 182, 212, 0.28);
}

.brand-text {
    font-size: 1.28rem;
    background: linear-gradient(90deg, #60a5fa, #67e8f9, #3b82f6);
    -webkit-background-clip: text;
    color: transparent;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.desktop-nav > a,
.nav-dropdown > button {
    color: #dbeafe;
    font-weight: 600;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 8px 0;
}

.desktop-nav > a:hover,
.nav-dropdown > button:hover,
.dropdown-panel a:hover,
.mobile-menu a:hover {
    color: #67e8f9;
}

.nav-dropdown {
    position: relative;
}

.dropdown-panel {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    width: 184px;
    transform: translate(-50%, 8px);
    opacity: 0;
    visibility: hidden;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.98);
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.nav-dropdown:hover .dropdown-panel,
.nav-dropdown:focus-within .dropdown-panel {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}

.dropdown-panel a,
.mobile-menu a {
    display: block;
    padding: 10px 12px;
    color: var(--soft);
    border-radius: 10px;
}

.dropdown-panel a:hover,
.mobile-menu a:hover {
    background: rgba(30, 64, 175, 0.36);
}

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

.header-search input,
.search-page-form input,
.filter-panel input,
.filter-panel select {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.76);
    color: var(--text);
    outline: none;
    padding: 0 16px;
}

.header-search input {
    width: 210px;
}

.header-search input:focus,
.search-page-form input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
    border-color: rgba(103, 232, 249, 0.86);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.18);
}

.header-search button,
.primary-button,
.secondary-button {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 800;
    white-space: nowrap;
}

.header-search button,
.primary-button {
    background: linear-gradient(90deg, #06b6d4, #2563eb);
    color: white;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.3);
}

.header-search button {
    min-height: 40px;
    padding: 0 16px;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-2px) scale(1.02);
}

.secondary-button {
    color: #dbeafe;
    border: 1px solid rgba(103, 232, 249, 0.45);
    background: rgba(15, 23, 42, 0.7);
}

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: white;
    background: rgba(15, 23, 42, 0.72);
    cursor: pointer;
}

.mobile-menu {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 8px 0 18px;
}

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

.hero-carousel {
    position: relative;
    height: min(620px, 82vh);
    min-height: 520px;
    overflow: hidden;
    background: #020617;
}

.hero-track,
.hero-slide {
    position: absolute;
    inset: 0;
}

.hero-slide {
    opacity: 0;
    background-position: center;
    background-size: cover;
    transition: opacity 0.9s ease;
}

.hero-slide.is-active {
    opacity: 1;
    z-index: 2;
}

.hero-content {
    width: min(1180px, calc(100% - 32px));
    min-height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 88px 0 84px;
}

.hero-kicker,
.section-kicker {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.95), rgba(37, 99, 235, 0.95));
    color: white;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 7px 14px;
    text-transform: uppercase;
}

.hero-content h1,
.page-hero h1 {
    max-width: 780px;
    margin: 20px 0 16px;
    font-size: clamp(2.4rem, 7vw, 5.1rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero-content p,
.page-hero p {
    max-width: 720px;
    margin: 0;
    color: #cbd5e1;
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.8;
}

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

.hero-tags {
    margin: 24px 0;
}

.hero-tags span,
.detail-meta span,
.tag-cloud span {
    display: inline-flex;
    border: 1px solid rgba(103, 232, 249, 0.28);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.62);
    color: #e0f2fe;
    padding: 7px 12px;
    font-size: 0.9rem;
}

.hero-actions {
    gap: 14px;
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    transform: translateY(-50%);
    color: white;
    background: rgba(2, 6, 23, 0.55);
    cursor: pointer;
    font-size: 2.1rem;
    line-height: 1;
}

.hero-control:hover {
    background: rgba(6, 182, 212, 0.86);
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

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

.hero-dot.is-active {
    width: 32px;
    background: #22d3ee;
}

.page-hero {
    min-height: 390px;
    display: flex;
    align-items: flex-end;
    background-position: center;
    background-size: cover;
    padding: 88px 0 64px;
    border-bottom: 1px solid var(--line);
}

.small-hero {
    min-height: 320px;
    background:
        radial-gradient(circle at top right, rgba(6, 182, 212, 0.22), transparent 28rem),
        linear-gradient(135deg, #020617, #172554 52%, #020617);
}

.section-block {
    padding: 56px 0;
}

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

.section-head h2,
.category-overview-head h2,
.detail-section h2,
.side-card h2 {
    margin: 8px 0 0;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.section-head a,
.category-overview-head a,
.detail-side a {
    color: #67e8f9;
    font-weight: 700;
}

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

.category-tile {
    position: relative;
    min-height: 190px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
    box-shadow: var(--shadow);
    padding: 22px;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-tile:hover,
.movie-card:hover {
    transform: translateY(-8px);
    border-color: rgba(34, 211, 238, 0.7);
}

.category-icon {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    font-size: 1.7rem;
}

.category-tile strong,
.category-tile em {
    display: block;
    position: relative;
    z-index: 2;
}

.category-tile strong {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.category-tile em {
    color: var(--muted);
    font-style: normal;
    line-height: 1.7;
}

.category-tile img {
    position: absolute;
    right: -24px;
    bottom: -32px;
    width: 150px;
    height: 110px;
    object-fit: cover;
    border-radius: 20px;
    opacity: 0.26;
    transform: rotate(-8deg);
}

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

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

.movie-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98));
    box-shadow: 0 18px 44px rgba(2, 6, 23, 0.36);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card.is-hidden {
    display: none;
}

.thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #020617;
}

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

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

.thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.74));
    opacity: 0.92;
}

.duration,
.card-badge {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 9px;
}

.duration {
    right: 10px;
    bottom: 10px;
    background: rgba(2, 6, 23, 0.78);
}

.card-badge {
    left: 10px;
    top: 10px;
    background: rgba(6, 182, 212, 0.9);
}

.card-body {
    display: flex;
    min-height: 188px;
    flex-direction: column;
    padding: 18px;
}

.card-body h2,
.card-body h3 {
    margin: 0 0 10px;
    color: #fff;
    font-size: 1.08rem;
    line-height: 1.38;
}

.card-desc {
    display: -webkit-box;
    min-height: 48px;
    overflow: hidden;
    color: var(--soft);
    line-height: 1.62;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-meta {
    margin-top: auto;
    padding-top: 14px;
    color: var(--muted);
    font-size: 0.86rem;
}

.card-meta span::after {
    content: "·";
    margin-left: 10px;
    color: rgba(148, 163, 184, 0.48);
}

.card-meta span:last-child::after {
    content: "";
    margin: 0;
}

.tag-line {
    margin-top: 10px;
    color: #67e8f9;
    font-size: 0.84rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-panel {
    border: 1px solid var(--line);
    border-radius: 26px;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.94), rgba(2, 6, 23, 0.94));
    box-shadow: var(--shadow);
    padding: 18px;
}

.rank-row {
    display: grid;
    grid-template-columns: 44px 108px 1fr;
    align-items: center;
    gap: 16px;
    border-radius: 18px;
    padding: 13px;
    transition: background 0.2s ease;
}

.rank-row:hover {
    background: rgba(30, 64, 175, 0.28);
}

.rank-number {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #334155;
    color: #cbd5e1;
    font-weight: 900;
}

.rank-1 {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
}

.rank-2 {
    background: linear-gradient(135deg, #e2e8f0, #94a3b8);
    color: #111827;
}

.rank-3 {
    background: linear-gradient(135deg, #d97706, #92400e);
    color: white;
}

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

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

.rank-info strong {
    color: white;
    margin-bottom: 6px;
}

.rank-info em {
    color: var(--muted);
    font-style: normal;
    font-size: 0.9rem;
}

.category-overview-card,
.filter-panel,
.side-card {
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(15, 23, 42, 0.78);
    box-shadow: var(--shadow);
}

.category-overview-card {
    padding: 24px;
    margin-bottom: 28px;
}

.category-overview-head span:first-child {
    font-size: 2rem;
}

.category-overview-head p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(3, 180px);
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    border-radius: 14px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(290px, 0.9fr);
    gap: 28px;
    padding: 34px 0 16px;
}

.breadcrumb {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.94rem;
}

.breadcrumb a {
    color: #67e8f9;
}

.player-panel {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: black;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

.movie-video {
    width: 100%;
    height: 100%;
    background: black;
    object-fit: contain;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: radial-gradient(circle at center, rgba(6, 182, 212, 0.18), rgba(2, 6, 23, 0.36));
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-overlay span {
    width: 92px;
    height: 92px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: white;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.96), rgba(37, 99, 235, 0.96));
    box-shadow: 0 18px 42px rgba(6, 182, 212, 0.3);
    font-size: 2.25rem;
    padding-left: 6px;
}

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

.detail-title-block {
    margin-top: 24px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 22px;
}

.detail-title-block h1 {
    margin: 0 0 16px;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.12;
}

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

.detail-section p,
.side-card p {
    color: var(--soft);
    line-height: 1.92;
    font-size: 1.02rem;
}

.detail-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.side-card {
    padding: 20px;
}

.poster-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 20px;
    margin-bottom: 18px;
}

.info-list {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 12px 16px;
    margin: 18px 0 0;
}

.info-list dt {
    color: var(--muted);
}

.info-list dd {
    margin: 0;
    color: white;
}

.search-page-form {
    display: flex;
    gap: 12px;
    margin-top: 26px;
}

.search-page-form input {
    width: min(560px, 100%);
    border-radius: 18px;
}

.site-footer {
    margin-top: 56px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), #020617);
    padding: 46px 0 28px;
}

.footer-grid {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 0.8fr;
    gap: 32px;
}

.footer-grid p,
.footer-grid a,
.footer-bottom {
    color: var(--muted);
    line-height: 1.8;
}

.footer-grid h2 {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.footer-grid a {
    display: block;
}

.footer-grid a:hover {
    color: #67e8f9;
}

.footer-bottom {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto 0;
    border-top: 1px solid rgba(59, 130, 246, 0.18);
    padding-top: 20px;
    font-size: 0.92rem;
}

@media (max-width: 1024px) {
    .desktop-nav,
    .header-search {
        display: none;
    }

    .mobile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
    }

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

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

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

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

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

@media (max-width: 680px) {
    .header-inner {
        width: min(100% - 24px, 1180px);
        height: 62px;
    }

    .brand-text {
        font-size: 1.05rem;
    }

    .hero-carousel {
        min-height: 560px;
    }

    .hero-control {
        top: auto;
        bottom: 78px;
        width: 42px;
        height: 42px;
        transform: none;
    }

    .hero-prev {
        left: 16px;
    }

    .hero-next {
        right: 16px;
    }

    .hero-content {
        padding: 76px 0 116px;
    }

    .page-hero {
        min-height: 320px;
    }

    .section-head,
    .category-overview-head,
    .search-page-form {
        align-items: flex-start;
        flex-direction: column;
    }

    .category-grid,
    .movie-grid,
    .compact-grid,
    .mini-grid,
    .filter-panel,
    .detail-side,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .rank-row {
        grid-template-columns: 36px 86px 1fr;
        gap: 12px;
        padding: 10px;
    }

    .rank-row img {
        width: 86px;
        height: 58px;
    }

    .player-overlay span {
        width: 76px;
        height: 76px;
    }
}
