:root {
    color-scheme: light;
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-200: #fde68a;
    --amber-300: #fcd34d;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
    --amber-700: #b45309;
    --amber-800: #92400e;
    --amber-900: #78350f;
    --orange-50: #fff7ed;
    --orange-100: #ffedd5;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --text: #1f2937;
    --muted: #6b7280;
    --line: rgba(180, 83, 9, 0.22);
    --card: #ffffff;
    --shadow: 0 18px 45px rgba(146, 64, 14, 0.14);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, var(--amber-50), var(--orange-50) 48%, var(--amber-50));
    min-height: 100vh;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(90deg, rgba(255, 251, 235, 0.96), rgba(255, 237, 213, 0.96));
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 26px rgba(146, 64, 14, 0.08);
    backdrop-filter: blur(16px);
}

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

.site-logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: linear-gradient(135deg, var(--amber-600), var(--orange-600));
    box-shadow: 0 10px 24px rgba(217, 119, 6, 0.24);
}

.logo-text {
    font-size: 24px;
    background: linear-gradient(90deg, var(--amber-800), var(--orange-600));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    font-weight: 700;
    color: #4b5563;
}

.desktop-nav a,
.mobile-nav a {
    transition: color 0.2s ease;
}

.desktop-nav a:hover,
.mobile-nav a:hover {
    color: var(--amber-700);
}

.header-search {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    padding: 4px;
    min-width: 250px;
}

.header-search input {
    border: 0;
    outline: 0;
    background: transparent;
    min-width: 0;
    padding: 8px 12px;
    flex: 1;
}

.header-search button,
.quick-search-form button {
    border: 0;
    border-radius: 999px;
    color: white;
    background: linear-gradient(135deg, var(--amber-600), var(--orange-600));
    padding: 8px 16px;
    font-weight: 700;
}

.mobile-toggle {
    display: none;
    border: 0;
    background: transparent;
    color: var(--amber-800);
    font-size: 28px;
}

.mobile-nav {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid var(--line);
}

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

.hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    overflow: hidden;
    background: #111827;
}

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

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

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

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.52) 48%, rgba(0, 0, 0, 0.08));
}

.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
}

.hero-copy {
    width: min(680px, 100%);
    color: white;
    padding-top: 28px;
}

.hero-badge,
.section-kicker {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.92);
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.25);
}

.hero h1 {
    margin: 18px 0 14px;
    font-size: clamp(42px, 7vw, 76px);
    line-height: 1.04;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.hero p {
    margin: 0;
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.88);
}

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

.hero-tags {
    margin: 22px 0 26px;
}

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

.hero-tags span {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.tag-row span {
    color: var(--amber-800);
    background: var(--amber-100);
}

.tag-row.large span {
    padding: 8px 14px;
    font-size: 14px;
}

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

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

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

.btn.primary {
    color: white;
    background: linear-gradient(135deg, var(--amber-600), var(--orange-600));
    box-shadow: 0 16px 32px rgba(249, 115, 22, 0.28);
}

.btn.ghost {
    color: white;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
}

.btn.small {
    min-height: 38px;
    padding: 0 16px;
    color: var(--amber-800);
    background: var(--amber-100);
}

.btn.full {
    width: 100%;
}

.hero-thumbs {
    position: absolute;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.hero-thumb {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 16px;
    padding: 8px;
    color: white;
    background: rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(12px);
    text-align: left;
    overflow: hidden;
    transition: background 0.2s ease, transform 0.2s ease;
}

.hero-thumb.active,
.hero-thumb:hover {
    background: rgba(245, 158, 11, 0.78);
    transform: translateY(-2px);
}

.hero-thumb img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    flex: none;
}

.hero-thumb span {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.quick-search-block {
    background: white;
    border-bottom: 1px solid var(--line);
}

.quick-search-inner {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 520px);
    gap: 24px;
    align-items: center;
    padding: 24px 0;
}

.quick-search-inner strong {
    font-size: 24px;
    color: var(--amber-900);
}

.quick-search-inner p {
    margin: 6px 0 0;
    color: var(--muted);
}

.quick-search-form {
    display: flex;
    gap: 8px;
    border: 1px solid var(--line);
    padding: 6px;
    border-radius: 999px;
    background: var(--amber-50);
}

.quick-search-form input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 10px 14px;
}

.section.padded {
    padding: 58px 0;
}

.white-section {
    background: rgba(255, 255, 255, 0.72);
}

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

.section-heading h2 {
    margin: 12px 0 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
    color: #111827;
}

.section-heading p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.8;
}

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

.category-card {
    min-height: 150px;
    border: 1px solid rgba(180, 83, 9, 0.16);
    border-radius: var(--radius);
    background: linear-gradient(135deg, white, var(--amber-50));
    padding: 20px;
    box-shadow: 0 12px 32px rgba(146, 64, 14, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.category-card span {
    display: block;
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: 900;
    color: var(--amber-900);
}

.category-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    font-size: 14px;
}

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

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

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

.movie-card {
    border-radius: var(--radius);
    overflow: hidden;
    background: white;
    box-shadow: 0 12px 30px rgba(146, 64, 14, 0.1);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

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

.movie-cover {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(135deg, var(--amber-200), var(--orange-100));
}

.movie-cover.small {
    width: 112px;
    height: 132px;
    aspect-ratio: auto;
    flex: none;
}

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

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

.movie-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 36%, rgba(0, 0, 0, 0.72));
    opacity: 0;
    transition: opacity 0.24s ease;
}

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

.movie-type,
.rank-badge {
    position: absolute;
    z-index: 2;
    top: 12px;
    border-radius: 999px;
    padding: 5px 10px;
    color: white;
    font-size: 12px;
    font-weight: 900;
}

.movie-type {
    right: 12px;
    background: var(--amber-500);
}

.rank-badge {
    left: 12px;
    background: rgba(0, 0, 0, 0.72);
}

.cover-title {
    position: absolute;
    z-index: 2;
    left: 14px;
    right: 14px;
    bottom: 14px;
    color: white;
    font-weight: 900;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.movie-card:hover .cover-title {
    opacity: 1;
    transform: translateY(0);
}

.movie-info {
    padding: 18px;
}

.movie-info.compact {
    padding: 0;
    min-width: 0;
}

.movie-meta-line,
.movie-meta {
    color: var(--amber-700);
    font-size: 13px;
    font-weight: 800;
}

.movie-meta-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.movie-info h3 {
    margin: 0 0 10px;
    font-size: 19px;
    line-height: 1.35;
}

.movie-title {
    display: block;
    font-size: 17px;
    font-weight: 900;
    color: #111827;
    line-height: 1.4;
    margin-bottom: 6px;
}

.movie-info h3 a:hover,
.movie-title:hover {
    color: var(--amber-700);
}

.movie-info p,
.movie-desc {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.7;
    font-size: 14px;
}

.movie-card-horizontal {
    display: flex;
    gap: 14px;
    padding: 10px;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(146, 64, 14, 0.08);
}

.movie-card-horizontal:hover {
    transform: translateY(-2px);
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 30px;
    align-items: start;
}

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

.ranking-panel,
.related-card,
.poster-card,
.detail-card,
.category-overview-block,
.ranking-side {
    border-radius: 22px;
    background: white;
    box-shadow: var(--shadow);
}

.ranking-panel,
.related-card,
.ranking-side {
    padding: 22px;
}

.ranking-panel {
    position: sticky;
    top: 90px;
}

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

.panel-title span,
.related-card h2,
.ranking-side h2 {
    font-size: 24px;
    font-weight: 900;
    color: #111827;
}

.panel-title a {
    color: var(--amber-700);
    font-weight: 900;
}

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

.page-hero {
    padding: 72px 0;
    color: white;
    background:
        radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.36), transparent 28%),
        linear-gradient(135deg, #78350f, #9a3412 52%, #111827);
}

.page-hero span {
    display: inline-flex;
    border-radius: 999px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.18);
    font-weight: 900;
}

.page-hero h1 {
    margin: 16px 0 12px;
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.1;
}

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

.overview-list {
    display: grid;
    gap: 26px;
}

.category-overview-block {
    padding: 24px;
}

.category-overview-head h2 {
    margin: 0 0 8px;
    font-size: 30px;
}

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

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px 180px;
    gap: 12px;
    margin-bottom: 28px;
    padding: 14px;
    border-radius: 20px;
    background: white;
    box-shadow: 0 12px 30px rgba(146, 64, 14, 0.08);
}

.filter-bar.wide {
    grid-template-columns: minmax(220px, 1fr) 170px 170px 170px;
}

.filter-bar input,
.filter-bar select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--amber-50);
    outline: 0;
    padding: 12px 16px;
    color: var(--text);
}

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

.ranking-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 30px;
    align-items: start;
}

.rank-page-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ranking-side {
    position: sticky;
    top: 90px;
}

.side-grid {
    margin-top: 18px;
    grid-template-columns: 1fr;
}

.detail-section {
    padding: 34px 0 58px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 22px;
    color: var(--amber-800);
    font-weight: 800;
}

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

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

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #0f172a;
    aspect-ratio: 16 / 9;
    box-shadow: var(--shadow);
}

.player-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #0f172a;
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    color: white;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.72));
    text-align: center;
}

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

.play-circle {
    width: 76px;
    height: 76px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--amber-500), var(--orange-600));
    box-shadow: 0 18px 40px rgba(245, 158, 11, 0.34);
    font-size: 30px;
    padding-left: 5px;
}

.play-title {
    max-width: min(90%, 760px);
    font-size: clamp(24px, 4vw, 42px);
    font-weight: 900;
}

.play-text {
    font-weight: 900;
    color: rgba(255, 255, 255, 0.84);
}

.detail-card {
    margin-top: 24px;
    padding: 28px;
}

.detail-card h1 {
    margin: 0 0 16px;
    color: #111827;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.15;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

.detail-meta span {
    border-radius: 999px;
    padding: 7px 13px;
    color: var(--amber-800);
    background: var(--amber-100);
    font-size: 14px;
    font-weight: 900;
}

.detail-card section {
    padding: 22px 0;
    border-top: 1px solid rgba(180, 83, 9, 0.14);
}

.detail-card h2 {
    margin: 0 0 12px;
    font-size: 22px;
    color: #111827;
}

.detail-card p {
    margin: 0;
    color: #4b5563;
    line-height: 1.9;
    white-space: pre-line;
}

.detail-side {
    display: grid;
    gap: 22px;
    position: sticky;
    top: 90px;
}

.poster-card {
    padding: 16px;
}

.poster-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 18px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, var(--amber-200), var(--orange-100));
}

.site-footer {
    color: var(--amber-50);
    background: linear-gradient(90deg, var(--amber-900), #7c2d12);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 32px;
    padding: 46px 0;
}

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

.site-footer p {
    margin: 0;
    color: var(--amber-200);
    line-height: 1.8;
}

.site-footer h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.site-footer a {
    color: var(--amber-200);
}

.site-footer a:hover {
    color: white;
}

.footer-bottom {
    width: min(100% - 32px, 1280px);
    margin: 0 auto;
    padding: 22px 0;
    border-top: 1px solid rgba(254, 243, 199, 0.16);
    display: flex;
    justify-content: space-between;
    gap: 18px;
    color: var(--amber-200);
    font-size: 14px;
}

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

    .mobile-toggle {
        display: block;
    }

    .header-search {
        max-width: 360px;
        flex: 1;
    }

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

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

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

    .ranking-panel,
    .ranking-side,
    .detail-side {
        position: static;
    }
}

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

    .header-inner {
        gap: 10px;
    }

    .logo-text {
        font-size: 20px;
    }

    .header-search {
        display: none;
    }

    .hero {
        min-height: 620px;
        height: 78vh;
    }

    .hero-shade {
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0.82));
    }

    .hero-content {
        align-items: flex-start;
        padding-top: 80px;
    }

    .hero-thumbs {
        grid-template-columns: 1fr;
        width: min(100% - 24px, 480px);
    }

    .hero-thumb:nth-child(n + 4) {
        display: none;
    }

    .quick-search-inner,
    .footer-grid,
    .footer-bottom {
        grid-template-columns: 1fr;
        display: grid;
    }

    .quick-search-form {
        border-radius: 20px;
        align-items: stretch;
        flex-direction: column;
    }

    .category-grid,
    .movie-grid,
    .movie-grid.compact-grid,
    .catalog-grid,
    .two-row,
    .rank-page-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-bar,
    .filter-bar.wide {
        grid-template-columns: 1fr;
    }

    .category-overview-head,
    .panel-title {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 540px) {
    .hero h1 {
        font-size: 38px;
    }

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

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

    .btn {
        width: 100%;
    }

    .category-grid,
    .movie-grid,
    .movie-grid.compact-grid,
    .catalog-grid,
    .rank-page-list {
        grid-template-columns: 1fr;
    }

    .movie-card-horizontal {
        gap: 10px;
    }

    .movie-cover.small {
        width: 96px;
        height: 120px;
    }

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