* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f9fafb;
    color: #1f2937;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.65;
}

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

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

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: linear-gradient(90deg, #2563eb, #1e40af);
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(30, 64, 175, 0.25);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 210px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #f97316;
    font-size: 18px;
    box-shadow: 0 10px 20px rgba(249, 115, 22, 0.35);
}

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

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

.brand-text small {
    margin-top: 3px;
    color: #bfdbfe;
    font-size: 12px;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 15px;
}

.nav-link {
    position: relative;
    color: #eff6ff;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: #fb923c;
}

.nav-link.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -9px;
    height: 2px;
    border-radius: 999px;
    background: #fb923c;
}

.mobile-menu-button {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
}

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

.mobile-nav {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    background: #1d4ed8;
}

.mobile-nav a {
    display: block;
    padding: 12px 24px;
    color: #ffffff;
}

.mobile-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fed7aa;
}

.mobile-nav.open {
    display: block;
}

.hero {
    position: relative;
    height: 500px;
    overflow: hidden;
    background: linear-gradient(135deg, #111827, #1d4ed8 55%, #111827);
}

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

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.32;
    transform: scale(1.04);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.08));
}

.hero-content {
    color: #ffffff;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: #fbbf24;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.eyebrow::before {
    content: "★";
    color: currentColor;
}

.eyebrow.dark {
    color: #2563eb;
}

.hero h1 {
    max-width: 820px;
    margin: 0 0 18px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.03em;
}

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

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

.hero-tags span,
.meta-pills span,
.meta-pills a,
.tag-cloud span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 14px;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 12px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn.primary {
    background: #f97316;
    color: #ffffff;
    box-shadow: 0 12px 22px rgba(249, 115, 22, 0.32);
}

.btn.primary:hover {
    background: #ea580c;
}

.btn.ghost {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(8px);
}

.btn.full {
    width: 100%;
}

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

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

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

.search-band {
    padding: 42px 0 8px;
}

.search-panel {
    padding: 28px;
    border-radius: 24px;
    background: linear-gradient(90deg, #f0fdf4, #eff6ff);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.search-panel h2 {
    margin: 0 0 18px;
    color: #1f2937;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.2;
}

.search-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 12px;
    margin: 20px 0 26px;
}

.search-controls.compact {
    grid-template-columns: minmax(220px, 320px) 150px;
    margin: 0;
}

.search-controls input,
.search-controls select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    color: #111827;
    padding: 0 16px;
    outline: none;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.search-controls input:focus,
.search-controls select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

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

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

.section-heading.wrap {
    align-items: center;
}

.section-heading h2 {
    margin: 0;
    color: #1f2937;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.15;
    font-weight: 800;
}

.section-heading p {
    margin: 8px 0 0;
    color: #6b7280;
}

.section-heading a {
    color: #2563eb;
    font-weight: 700;
}

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

.movie-grid.wide-grid,
.featured-search-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.movie-card {
    overflow: hidden;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.09);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.16);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(135deg, #1d4ed8, #f97316);
}

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

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

.poster-shade {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.22s ease;
}

.movie-card:hover .poster-shade {
    background: rgba(0, 0, 0, 0.32);
}

.play-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #f97316;
    font-size: 22px;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

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

.card-badge,
.year-badge {
    position: absolute;
    top: 10px;
    max-width: calc(100% - 20px);
    padding: 4px 9px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.card-badge {
    left: 10px;
    background: #f97316;
}

.year-badge {
    right: 10px;
    background: rgba(17, 24, 39, 0.82);
}

.card-body {
    padding: 14px;
}

.card-body h3 {
    min-height: 48px;
    margin: 0 0 8px;
    color: #1f2937;
    font-size: 15px;
    line-height: 1.45;
    font-weight: 800;
}

.card-body h3 a:hover {
    color: #ea580c;
}

.card-meta,
.card-line {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

.card-line {
    display: -webkit-box;
    min-height: 42px;
    margin-top: 8px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

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

.category-card {
    display: block;
    min-height: 210px;
    padding: 24px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
}

.category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    border-radius: 16px;
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 12px 22px rgba(239, 68, 68, 0.24);
}

.category-card h2 {
    margin: 0 0 10px;
    color: #111827;
    font-size: 20px;
    font-weight: 800;
}

.category-card p {
    margin: 0 0 14px;
    color: #4b5563;
    font-size: 14px;
}

.category-card small {
    color: #6b7280;
}

.accent-red .category-icon,
.page-hero.accent-red {
    background: linear-gradient(135deg, #ef4444, #f97316);
}

.accent-pink .category-icon,
.page-hero.accent-pink {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
}

.accent-blue .category-icon,
.page-hero.accent-blue {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.accent-purple .category-icon,
.page-hero.accent-purple {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.accent-green .category-icon,
.page-hero.accent-green {
    background: linear-gradient(135deg, #16a34a, #059669);
}

.accent-orange .category-icon,
.page-hero.accent-orange {
    background: linear-gradient(135deg, #f97316, #dc2626);
}

.accent-teal .category-icon,
.page-hero.accent-teal {
    background: linear-gradient(135deg, #0d9488, #0891b2);
}

.accent-cyan .category-icon,
.page-hero.accent-cyan {
    background: linear-gradient(135deg, #06b6d4, #2563eb);
}

.accent-indigo .category-icon,
.page-hero.accent-indigo {
    background: linear-gradient(135deg, #4f46e5, #1d4ed8);
}

.accent-gray .category-icon,
.page-hero.accent-gray {
    background: linear-gradient(135deg, #374151, #111827);
}

.ranking-panel {
    display: grid;
    grid-template-columns: 0.9fr 1.4fr;
    gap: 34px;
    padding: 34px;
    border-radius: 26px;
    background: linear-gradient(135deg, #f97316, #dc2626);
    color: #ffffff;
    box-shadow: 0 24px 54px rgba(220, 38, 38, 0.22);
}

.ranking-copy h2 {
    margin: 0 0 16px;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.12;
    font-weight: 800;
}

.ranking-copy p {
    margin: 0 0 26px;
    color: #ffedd5;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 46px 56px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    transition: transform 0.2s ease, background 0.2s ease;
}

.rank-row:hover {
    transform: translateX(4px);
    background: #ffffff;
}

.rank-row img {
    width: 56px;
    height: 76px;
    border-radius: 10px;
    object-fit: cover;
    background: linear-gradient(135deg, #2563eb, #f97316);
}

.rank-row strong {
    display: block;
    overflow: hidden;
    color: #111827;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-row small {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: #6b7280;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #f97316;
    color: #ffffff;
    font-weight: 800;
}

.page-hero {
    padding: 76px 0;
    color: #ffffff;
    background: linear-gradient(90deg, #2563eb, #ea580c);
}

.page-hero.blue-orange {
    background: linear-gradient(90deg, #2563eb, #ea580c);
}

.page-hero.orange-red {
    background: linear-gradient(135deg, #f97316, #dc2626);
}

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

.page-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 18px;
}

.ranking-page-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.55fr;
    gap: 28px;
    align-items: start;
}

.rank-list.big .rank-row {
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.ranking-side,
.side-card,
.detail-card {
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.ranking-side {
    position: sticky;
    top: 92px;
    padding: 26px;
}

.ranking-side h2,
.side-card h2,
.detail-card h2 {
    margin: 0 0 14px;
    color: #111827;
    font-size: 22px;
    font-weight: 800;
}

.ranking-side p {
    color: #6b7280;
}

.detail-hero {
    padding: 34px 0 40px;
    background: #111827;
    color: #ffffff;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    color: #9ca3af;
    font-size: 14px;
}

.breadcrumbs a:hover {
    color: #fb923c;
}

.detail-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.14;
    font-weight: 800;
}

.detail-hero p {
    max-width: 860px;
    margin: 0;
    color: #d1d5db;
    font-size: 17px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    padding: 34px 0 58px;
}

.player-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: #000000;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
}

.movie-video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
    cursor: pointer;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    border: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.78));
    color: #ffffff;
    cursor: pointer;
}

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

.overlay-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: #f97316;
    color: #ffffff;
    font-size: 30px;
    box-shadow: 0 18px 34px rgba(249, 115, 22, 0.36);
}

.player-overlay strong {
    max-width: 80%;
    font-size: 22px;
    text-align: center;
}

.player-error {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 18px;
    display: none;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(220, 38, 38, 0.9);
    color: #ffffff;
    text-align: center;
}

.player-error.show {
    display: block;
}

.detail-card {
    margin-top: 22px;
    padding: 26px;
}

.meta-pills span,
.meta-pills a {
    background: #f3f4f6;
    color: #374151;
}

.meta-pills a:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.tag-cloud {
    margin: 18px 0 26px;
}

.tag-cloud span {
    background: #fff7ed;
    color: #9a3412;
}

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

.detail-card blockquote {
    margin: 0;
    padding: 20px;
    border-left: 4px solid #f97316;
    border-radius: 14px;
    background: #fff7ed;
    color: #1f2937;
}

.detail-side {
    display: grid;
    gap: 22px;
    align-content: start;
}

.side-card {
    padding: 22px;
}

.cover-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 16px;
    background: linear-gradient(135deg, #2563eb, #f97316);
}

.cover-card h2 {
    margin-top: 18px;
}

.cover-card p {
    color: #6b7280;
}

.rank-list.related .rank-row {
    grid-template-columns: 38px 56px minmax(0, 1fr);
    background: #f9fafb;
}

.empty-state {
    display: none;
    padding: 40px 0;
    color: #6b7280;
    text-align: center;
    font-size: 18px;
}

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

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

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

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

.site-footer p,
.site-footer a,
.site-footer li {
    color: #9ca3af;
    font-size: 14px;
}

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

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

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

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 0;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

@media (max-width: 1100px) {
    .desktop-nav {
        gap: 14px;
        font-size: 14px;
    }

    .movie-grid,
    .filter-grid,
    .movie-grid.wide-grid,
    .featured-search-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

    .detail-layout,
    .ranking-page-grid,
    .ranking-panel {
        grid-template-columns: 1fr;
    }

    .ranking-side {
        position: static;
    }
}

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

    .mobile-menu-button {
        display: block;
    }

    .brand {
        min-width: 0;
    }

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

    .brand-text small {
        display: none;
    }

    .hero {
        height: 560px;
    }

    .hero-overlay {
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.84));
    }

    .hero p {
        font-size: 16px;
    }

    .search-controls,
    .search-controls.compact {
        grid-template-columns: 1fr;
    }

    .section-heading,
    .section-heading.wrap {
        align-items: flex-start;
        flex-direction: column;
    }

    .movie-grid,
    .filter-grid,
    .movie-grid.wide-grid,
    .featured-search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

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

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

    .rank-row {
        grid-template-columns: 42px 50px minmax(0, 1fr);
    }

    .rank-row img {
        width: 50px;
        height: 68px;
    }
}

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

    .hero-actions,
    .hero-tags {
        gap: 8px;
    }

    .btn {
        width: 100%;
    }

    .search-panel,
    .ranking-panel {
        padding: 22px;
        border-radius: 20px;
    }

    .movie-grid,
    .filter-grid,
    .movie-grid.wide-grid,
    .featured-search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .card-body {
        padding: 12px;
    }

    .card-body h3 {
        min-height: 42px;
        font-size: 14px;
    }

    .card-line {
        display: none;
    }

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

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