* {
    box-sizing: border-box;
}

:root {
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --panel: #ffffff;
    --soft: #f8fafc;
    --dark: #111827;
    --primary: #2563eb;
    --radius: 22px;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
    --rainbow: linear-gradient(90deg, #f87171, #facc15, #22c55e, #06b6d4, #3b82f6, #a855f7);
}

body {
    margin: 0;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: var(--text);
    background: #f3f4f6;
    line-height: 1.7;
}

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

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

.rainbow-line {
    height: 4px;
    background: var(--rainbow);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
}

.top-nav {
    max-width: 1280px;
    height: 68px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dc2626, #f97316, #9333ea);
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.35);
}

.brand-text {
    font-size: 24px;
    background: var(--rainbow);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

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

.nav-link {
    font-weight: 700;
    color: #374151;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.search-toggle,
.mobile-toggle,
.search-submit,
.back-top {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.search-toggle,
.mobile-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #374151;
}

.mobile-toggle {
    display: none;
}

.header-search,
.mobile-panel {
    display: none;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px 18px;
}

.header-search.open,
.mobile-panel.open {
    display: block;
}

.search-form {
    display: flex;
    gap: 12px;
}

.search-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 13px 18px;
    outline: none;
    font-size: 15px;
    background: #ffffff;
}

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

.search-submit,
.primary-btn,
.secondary-btn,
.text-link,
.section-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-submit,
.primary-btn {
    border-radius: 999px;
    padding: 13px 24px;
    color: #111827;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
    white-space: nowrap;
}

.search-submit:hover,
.primary-btn:hover,
.secondary-btn:hover,
.section-more:hover,
.text-link:hover {
    transform: translateY(-2px);
}

.secondary-btn {
    border-radius: 999px;
    padding: 12px 22px;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}

.hero {
    position: relative;
    min-height: 72vh;
    overflow: hidden;
    background: var(--rainbow);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-slide.active {
    opacity: 1;
    position: relative;
}

.hero-slide img {
    position: absolute;
    inset: 0;
    height: 100%;
    object-fit: cover;
    opacity: 0.62;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.68));
}

.hero-content {
    position: relative;
    max-width: 920px;
    min-height: 72vh;
    margin: 0 auto;
    padding: 92px 24px;
    color: #ffffff;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-logo-mark {
    padding: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    margin-bottom: 24px;
}

.hero-logo-mark .brand-icon {
    width: 62px;
    height: 62px;
    font-size: 22px;
}

.eyebrow {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
}

.hero h1 {
    margin: 0;
    font-size: clamp(36px, 6vw, 76px);
    line-height: 1.08;
    text-shadow: 0 8px 26px rgba(0, 0, 0, 0.32);
}

.hero h2 {
    margin: 18px 0 0;
    font-size: clamp(26px, 3vw, 44px);
}

.hero-desc {
    max-width: 760px;
    margin: 20px auto 34px;
    font-size: clamp(17px, 2vw, 22px);
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.32);
}

.hero-actions,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.hero-dots {
    position: absolute;
    bottom: 28px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.hero-dots button {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
}

.hero-dots button.active {
    width: 34px;
    border-radius: 999px;
    background: #ffffff;
}

.home-search-panel {
    max-width: 1100px;
    margin: -32px auto 0;
    padding: 22px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 4;
}

.big-search .search-submit {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
}

.quick-links,
.filter-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.quick-links a,
.filter-strip a,
.tag-row span,
.movie-year {
    border-radius: 999px;
    padding: 7px 12px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 13px;
    font-weight: 700;
}

.content-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 72px 24px;
}

.white-section {
    max-width: none;
    background: #ffffff;
}

.white-section > .section-heading,
.white-section > .movie-grid,
.white-section > .detail-pager {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

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

.section-heading h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 40px);
}

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

.section-more,
.text-link {
    color: var(--primary);
}

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

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

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

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

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

.movie-cover {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--rainbow);
}

.movie-cover img {
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.movie-card:hover .movie-cover img {
    transform: scale(1.06);
}

.movie-year {
    position: absolute;
    right: 12px;
    top: 12px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(8px);
}

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

.movie-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.movie-meta-line a {
    color: var(--primary);
}

.movie-card h3,
.rank-info h2 {
    margin: 10px 0 8px;
    font-size: 20px;
    line-height: 1.35;
}

.movie-card p,
.rank-info p,
.category-card p,
.category-feature p {
    color: var(--muted);
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-card p {
    -webkit-line-clamp: 3;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.movie-card-compact .movie-card-body {
    padding: 14px;
}

.movie-card-compact h3 {
    font-size: 17px;
}

.movie-card-compact p {
    -webkit-line-clamp: 2;
}

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

.category-feature,
.category-card,
.story-block,
.detail-side,
.player-shell {
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

.category-feature {
    padding: 24px;
}

.category-feature-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.category-feature h3,
.category-card h2,
.story-block h2,
.detail-side h2 {
    margin: 0 0 8px;
}

.category-feature-head a {
    color: var(--primary);
    font-weight: 800;
    white-space: nowrap;
}

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

.mini-grid .movie-card p,
.mini-grid .tag-row,
.mini-grid .movie-meta-line {
    display: none;
}

.mini-grid .movie-card h3 {
    margin-bottom: 0;
    font-size: 14px;
}

.page-hero {
    color: #ffffff;
    background: linear-gradient(135deg, #ef4444, #f59e0b, #22c55e, #2563eb, #9333ea);
}

.small-page-hero {
    padding: 82px 24px;
    text-align: center;
}

.small-page-hero h1 {
    margin: 0;
    font-size: clamp(34px, 5vw, 56px);
}

.small-page-hero p:not(.eyebrow) {
    max-width: 760px;
    margin: 16px auto 0;
    font-size: 18px;
}

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

.category-card {
    overflow: hidden;
    display: grid;
    grid-template-columns: 210px 1fr;
}

.category-posters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    background: #111827;
}

.category-posters img {
    height: 130px;
    object-fit: cover;
}

.category-card-body {
    padding: 24px;
}

.filter-strip {
    max-width: 1280px;
    margin: 26px auto 0;
    padding: 0 24px;
    justify-content: center;
}

.inline-search {
    margin-bottom: 24px;
}

.empty-state {
    display: none;
    padding: 40px;
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
    background: #ffffff;
}

.empty-state.show {
    display: block;
}

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

.rank-card {
    display: grid;
    grid-template-columns: 80px 110px 1fr;
    align-items: center;
    gap: 20px;
    padding: 16px;
}

.rank-number {
    font-size: 28px;
    font-weight: 900;
    color: #ffffff;
    border-radius: 22px;
    background: linear-gradient(135deg, #ef4444, #7c3aed);
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-cover img {
    height: 142px;
    object-fit: cover;
    border-radius: 18px;
}

.detail-hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background: #111827;
}

.detail-backdrop {
    position: absolute;
    inset: 0;
}

.detail-backdrop img {
    height: 100%;
    object-fit: cover;
    opacity: 0.32;
    filter: blur(4px);
}

.detail-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(17, 24, 39, 0.96), rgba(17, 24, 39, 0.68));
}

.detail-wrap {
    position: relative;
    max-width: 1280px;
    min-height: 620px;
    margin: 0 auto;
    padding: 64px 24px;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 42px;
    align-items: center;
}

.detail-poster img {
    border-radius: 30px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.74);
}

.detail-info h1 {
    margin: 0;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1.05;
}

.detail-one-line {
    max-width: 820px;
    margin: 22px 0;
    font-size: 20px;
}

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

.detail-actions {
    justify-content: flex-start;
    margin-top: 28px;
}

.player-section {
    max-width: 1100px;
    margin: -42px auto 0;
    padding: 0 24px;
    position: relative;
    z-index: 3;
}

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

.movie-video {
    width: 100%;
    height: 100%;
    display: block;
    background: #020617;
}

.play-layer {
    position: absolute;
    inset: 0;
    border: 0;
    color: #ffffff;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12), rgba(2, 6, 23, 0.72));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
}

.play-layer.hide {
    display: none;
}

.play-layer span {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    color: #111827;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

.play-layer strong {
    font-size: 22px;
}

.detail-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 64px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr 340px;
    gap: 24px;
}

.story-block,
.detail-side {
    padding: 28px;
}

.story-block p {
    margin: 0;
    color: #374151;
}

.detail-side dl {
    margin: 0;
    display: grid;
    grid-template-columns: 78px 1fr;
    gap: 12px;
}

.detail-side dt {
    color: var(--muted);
}

.detail-side dd {
    margin: 0;
    font-weight: 800;
}

.detail-pager {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 28px;
}

.detail-pager a {
    flex: 1;
    padding: 18px;
    border-radius: 18px;
    background: #f3f4f6;
    color: #1f2937;
    font-weight: 800;
}

.site-footer {
    color: #d1d5db;
    background: #111827;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 46px 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.2fr;
    gap: 34px;
}

.footer-brand h2,
.footer-column h3 {
    color: #ffffff;
    margin: 0 0 12px;
}

.footer-logo {
    margin-bottom: 14px;
}

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

.footer-column li {
    margin: 8px 0;
}

.footer-column a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.back-top {
    border-radius: 999px;
    padding: 10px 16px;
    color: #ffffff;
    background: linear-gradient(135deg, #ef4444, #7c3aed);
}

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

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

    .detail-side {
        grid-column: 1 / -1;
    }
}

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

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

    .mobile-panel.open {
        display: grid;
        gap: 14px;
    }

    .mobile-nav-link {
        font-weight: 800;
        padding: 12px 0;
        color: #374151;
        border-bottom: 1px solid var(--line);
    }

    .hero-content {
        min-height: 66vh;
        padding: 72px 20px;
    }

    .home-search-panel {
        margin: 0 16px;
        border-radius: 22px;
    }

    .search-form {
        flex-direction: column;
    }

    .section-heading,
    .category-feature-head,
    .detail-pager,
    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

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

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

    .rank-card {
        grid-template-columns: 54px 90px 1fr;
        gap: 12px;
    }

    .rank-number {
        height: 58px;
        font-size: 20px;
    }

    .rank-cover img {
        height: 116px;
    }

    .detail-wrap {
        grid-template-columns: 1fr;
        min-height: auto;
    }

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

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

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

@media (max-width: 560px) {
    .top-nav {
        padding: 0 16px;
    }

    .brand-text {
        font-size: 19px;
    }

    .movie-grid,
    .wide-grid,
    .library-grid,
    .category-feature-grid,
    .category-grid,
    .mini-grid {
        grid-template-columns: 1fr;
    }

    .content-section {
        padding: 50px 16px;
    }

    .small-page-hero {
        padding: 60px 18px;
    }

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

    .rank-cover img {
        height: auto;
        aspect-ratio: 16 / 10;
    }

    .detail-wrap,
    .detail-content,
    .player-section {
        padding-left: 16px;
        padding-right: 16px;
    }

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