:root {
    color-scheme: light;
    --bg: #f8fafc;
    --bg-deep: #020617;
    --panel: #ffffff;
    --panel-soft: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --brand: #06b6d4;
    --brand-deep: #2563eb;
    --violet: #7c3aed;
    --shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 48%, #eef6ff 100%);
    color: var(--text);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

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

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

button,
input {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98));
    color: #ffffff;
    box-shadow: 0 14px 35px rgba(2, 6, 23, 0.25);
    backdrop-filter: blur(18px);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.brand-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #38bdf8, #06b6d4, #2563eb);
    box-shadow: 0 15px 35px rgba(6, 182, 212, 0.38);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.86);
}

.site-nav a {
    position: relative;
    padding: 22px 0;
    transition: color 0.2s ease;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 15px;
    height: 2px;
    transform: scaleX(0);
    transform-origin: left;
    background: #22d3ee;
    transition: transform 0.2s ease;
}

.site-nav a:hover {
    color: #67e8f9;
}

.site-nav a:hover::after {
    transform: scaleX(1);
}

.nav-toggle {
    display: none;
    border: 0;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
}

.page-hero,
.hero-carousel {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background:
        radial-gradient(circle at 18% 18%, rgba(34, 211, 238, 0.3), transparent 34%),
        radial-gradient(circle at 82% 20%, rgba(124, 58, 237, 0.32), transparent 30%),
        linear-gradient(135deg, #020617 0%, #0f172a 46%, #172554 100%);
}

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

.hero-glow {
    position: absolute;
    inset: auto -10% -25% -10%;
    height: 320px;
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.16), rgba(59, 130, 246, 0.22), rgba(124, 58, 237, 0.16));
    filter: blur(45px);
}

.hero-slides {
    position: relative;
    min-height: 620px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.hero-slide.is-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.hero-grid {
    min-height: 620px;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    align-items: center;
    gap: 46px;
    padding: 76px 0 92px;
}

.hero-kicker,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin-bottom: 16px;
    padding: 8px 13px;
    border: 1px solid rgba(103, 232, 249, 0.28);
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.14);
    color: #a5f3fc;
    font-size: 14px;
}

.hero-title {
    margin: 0 0 20px;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1.04;
    font-weight: 900;
    letter-spacing: -0.045em;
}

.hero-text {
    max-width: 740px;
    margin: 0 0 28px;
    color: rgba(226, 232, 240, 0.9);
    font-size: 18px;
    line-height: 1.9;
}

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

.tag,
.meta-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 12px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
}

.hero-actions,
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
}

.primary-button,
.ghost-button,
.small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 0;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
    min-height: 48px;
    padding: 0 24px;
    color: #ffffff;
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.28);
    font-weight: 800;
}

.ghost-button {
    min-height: 48px;
    padding: 0 22px;
    color: #e0f2fe;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-weight: 700;
}

.small-button {
    min-height: 38px;
    padding: 0 16px;
    color: #0f172a;
    background: #ffffff;
    font-weight: 700;
}

.primary-button:hover,
.ghost-button:hover,
.small-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.22);
}

.hero-poster {
    position: relative;
    min-height: 460px;
    border-radius: 34px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    box-shadow: 0 35px 80px rgba(2, 6, 23, 0.45);
}

.hero-poster img {
    width: 100%;
    height: 100%;
    min-height: 460px;
    object-fit: cover;
    transform: scale(1.02);
}

.hero-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 20%, rgba(2, 6, 23, 0.74));
}

.hero-poster-card {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    z-index: 1;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(18px);
}

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

.hero-dot {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.38);
    cursor: pointer;
}

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

.page-hero {
    padding: 76px 0;
}

.page-hero h1 {
    max-width: 820px;
    margin: 0 0 16px;
    font-size: clamp(34px, 5vw, 60px);
    line-height: 1.08;
    font-weight: 900;
}

.page-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(226, 232, 240, 0.88);
    font-size: 18px;
    line-height: 1.9;
}

.section {
    padding: 58px 0;
}

.section-alt {
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.86), rgba(255, 255, 255, 0.94));
}

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

.section-title {
    margin: 0;
    color: var(--text);
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.18;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.section-desc {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.8;
}

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

.movie-card {
    min-width: 0;
}

.movie-card a,
.rank-card,
.category-card,
.search-panel,
.detail-panel,
.info-panel {
    display: block;
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.86);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.movie-card a:hover,
.rank-card:hover,
.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.14);
}

.poster-frame {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a, #1e3a8a 56%, #06b6d4);
}

.poster-frame.tall {
    aspect-ratio: 3 / 4;
}

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

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

.poster-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 35%, rgba(2, 6, 23, 0.68));
}

.badge,
.play-dot,
.rank-number {
    position: absolute;
    z-index: 2;
}

.badge {
    top: 12px;
    right: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.68);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    backdrop-filter: blur(10px);
}

.play-dot {
    left: 50%;
    top: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.26);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transition: opacity 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(12px);
}

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

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

.movie-card h3,
.rank-card h3,
.category-card h2 {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 850;
}

.movie-card p,
.rank-card p,
.category-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.movie-card p {
    display: -webkit-box;
    min-height: 52px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 14px;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    color: var(--muted);
    font-size: 13px;
}

.movie-meta span {
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1f5f9;
}

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

.category-card {
    padding: 24px;
}

.category-card strong {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.22);
}

.search-panel {
    padding: 24px;
    margin-bottom: 26px;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.search-input {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 20px;
    color: var(--text);
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    border-color: rgba(6, 182, 212, 0.75);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.12);
}

.no-results {
    display: none;
    margin-top: 18px;
    color: var(--muted);
}

.no-results.is-visible {
    display: block;
}

.rank-list {
    display: grid;
    gap: 18px;
}

.rank-card {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 16px;
}

.rank-card .poster-frame {
    border-radius: 18px;
}

.rank-number {
    left: 12px;
    top: 12px;
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    color: #ffffff;
    background: linear-gradient(135deg, #f97316, #ef4444);
    font-weight: 900;
}

.rank-score {
    min-width: 96px;
    color: #2563eb;
    font-weight: 900;
    text-align: right;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: rgba(226, 232, 240, 0.78);
    font-size: 14px;
}

.breadcrumb a:hover {
    color: #67e8f9;
}

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

.player-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: #020617;
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.26);
}

.player-wrap video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #020617;
}

.player-cover {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.68));
    transition: opacity 0.24s ease, visibility 0.24s ease;
}

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

.player-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.76;
}

.player-start {
    position: relative;
    z-index: 4;
    width: 86px;
    height: 86px;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    box-shadow: 0 22px 45px rgba(37, 99, 235, 0.38);
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
}

.detail-panel,
.info-panel {
    padding: 28px;
    margin-top: 24px;
}

.detail-panel h2,
.info-panel h2 {
    margin: 0 0 14px;
    font-size: 24px;
    font-weight: 900;
}

.detail-panel p,
.info-panel p {
    margin: 0 0 16px;
    color: #334155;
    line-height: 1.95;
}

.side-card {
    position: sticky;
    top: 96px;
}

.side-card .poster-frame {
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.info-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.info-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
    color: var(--muted);
}

.info-list strong {
    color: var(--text);
}

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

.site-footer {
    margin-top: 40px;
    background: linear-gradient(180deg, #0f172a, #020617);
    color: rgba(226, 232, 240, 0.84);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 30px;
    padding: 44px 0;
}

.footer-grid h3,
.footer-grid h4 {
    margin: 0 0 14px;
    color: #ffffff;
}

.footer-grid p,
.footer-grid a {
    color: rgba(226, 232, 240, 0.78);
    line-height: 1.8;
}

.footer-links {
    display: grid;
    gap: 9px;
}

.footer-bottom {
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    padding: 18px 0 28px;
    text-align: center;
    font-size: 14px;
}

.back-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 60;
    width: 48px;
    height: 48px;
    display: none;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.3);
    cursor: pointer;
}

.back-top.is-visible {
    display: block;
}

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

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

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

    .side-card {
        position: static;
    }
}

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

    .nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        position: absolute;
        left: 12px;
        right: 12px;
        top: 70px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px;
        border-radius: 18px;
        background: rgba(15, 23, 42, 0.98);
        box-shadow: 0 22px 55px rgba(2, 6, 23, 0.36);
    }

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

    .site-nav a {
        padding: 12px 14px;
        border-radius: 12px;
    }

    .site-nav a:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .site-nav a::after {
        display: none;
    }

    .hero-carousel,
    .hero-slides,
    .hero-grid {
        min-height: auto;
    }

    .hero-slide {
        position: relative;
        display: none;
    }

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

    .hero-grid {
        padding: 52px 0 84px;
        gap: 28px;
    }

    .hero-poster,
    .hero-poster img {
        min-height: 360px;
    }

    .section-head {
        display: block;
    }

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

    .rank-card {
        grid-template-columns: 118px minmax(0, 1fr);
    }

    .rank-score {
        grid-column: 2;
        text-align: left;
    }

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

@media (max-width: 520px) {
    .movie-grid,
    .related-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }

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

    .brand span:last-child {
        max-width: 178px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .page-hero {
        padding: 54px 0;
    }
}
