:root {
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-200: #fde68a;
    --amber-600: #d97706;
    --amber-700: #b45309;
    --amber-900: #78350f;
    --red-50: #fff1f2;
    --red-100: #ffe4e6;
    --red-600: #dc2626;
    --red-700: #b91c1c;
    --red-800: #991b1b;
    --red-900: #7f1d1d;
    --stone-100: #f5f5f4;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-soft: 0 12px 35px rgba(120, 53, 15, 0.12);
    --shadow-card: 0 12px 25px rgba(127, 29, 29, 0.12);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: var(--gray-900);
    background: linear-gradient(180deg, var(--amber-50), var(--stone-100));
}

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

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

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 251, 235, 0.95);
    border-bottom: 1px solid var(--amber-200);
    box-shadow: 0 6px 24px rgba(120, 53, 15, 0.08);
    backdrop-filter: blur(14px);
}

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

.brand,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--amber-900);
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff7ed;
    background: linear-gradient(135deg, var(--amber-600), var(--red-700));
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(217, 119, 6, 0.28);
}

.brand-text {
    font-size: 24px;
    letter-spacing: -0.04em;
}

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

.nav-link {
    color: var(--amber-900);
    font-weight: 650;
    padding: 10px 2px;
    transition: color 0.2s ease;
}

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

.header-search {
    display: flex;
    align-items: center;
    border: 2px solid var(--amber-200);
    border-radius: 999px;
    background: var(--white);
    overflow: hidden;
}

.header-search input {
    width: 220px;
    border: 0;
    outline: 0;
    padding: 10px 14px 10px 18px;
    background: transparent;
}

.header-search button {
    border: 0;
    cursor: pointer;
    color: var(--white);
    background: var(--amber-600);
    padding: 10px 16px;
    transition: background 0.2s ease;
}

.header-search button:hover {
    background: var(--amber-700);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: var(--amber-100);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    background: var(--amber-900);
}

.hero-carousel {
    position: relative;
    height: 70vh;
    min-height: 520px;
    overflow: hidden;
    background: var(--gray-900);
}

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

.hero-slide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

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

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

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(217, 119, 6, 0.28), transparent 32%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.42) 48%, rgba(0, 0, 0, 0.12));
}

.hero-content {
    position: absolute;
    left: max(32px, calc((100vw - 1200px) / 2));
    bottom: 70px;
    width: min(760px, calc(100% - 64px));
    color: var(--white);
}

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

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

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

.tag-cloud span {
    color: var(--red-800);
    background: var(--red-100);
}

.hero-content h1 {
    margin: 18px 0 14px;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1.05;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.hero-content p {
    max-width: 680px;
    margin: 0 0 28px;
    color: #fef3c7;
    font-size: clamp(16px, 2vw, 21px);
    line-height: 1.7;
}

.hero-actions,
.section-head,
.detail-title-row,
.detail-meta,
.movie-meta-line {
    display: flex;
    align-items: center;
}

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

.primary-button,
.ghost-button,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-button {
    color: var(--white);
    background: var(--amber-600);
    padding: 13px 22px;
    box-shadow: 0 12px 28px rgba(217, 119, 6, 0.28);
}

.primary-button:hover {
    transform: translateY(-2px);
    background: var(--amber-700);
}

.primary-button.small {
    padding: 10px 16px;
    font-size: 14px;
}

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

.ghost-button:hover {
    background: rgba(255, 255, 255, 0.28);
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    color: var(--white);
    background: rgba(0, 0, 0, 0.32);
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.2s ease;
}

.hero-control:hover {
    background: rgba(0, 0, 0, 0.55);
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

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

.hero-dot.active {
    width: 28px;
    background: var(--amber-600);
}

.section-block,
.page-shell,
.detail-shell {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

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

.section-warm {
    border-radius: var(--radius-lg);
    padding-left: 24px;
    padding-right: 24px;
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.62), rgba(255, 228, 230, 0.6));
}

.section-head {
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.section-head h2 {
    margin: 0;
    color: var(--amber-900);
    font-size: clamp(26px, 3vw, 36px);
}

.section-head p {
    margin: 8px 0 0;
    color: var(--amber-700);
}

.section-head a,
.text-link {
    color: var(--amber-700);
    font-weight: 800;
}

.category-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.category-pill-list a {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    padding: 0 18px;
    color: var(--amber-900);
    background: var(--white);
    border: 1px solid var(--amber-200);
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, color 0.2s ease;
}

.category-pill-list a:hover {
    color: var(--amber-600);
    transform: translateY(-2px);
}

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

.movie-card {
    overflow: hidden;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 45px rgba(127, 29, 29, 0.18);
}

.movie-card a {
    display: block;
    height: 100%;
}

.poster-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    margin: 0;
    overflow: hidden;
    background: var(--gray-200);
}

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

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

.type-badge,
.year-badge,
.rank-badge {
    position: absolute;
    z-index: 2;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
}

.type-badge {
    top: 12px;
    left: 12px;
    color: var(--red-800);
    background: var(--red-100);
}

.year-badge {
    right: 12px;
    bottom: 12px;
    color: var(--white);
    background: rgba(0, 0, 0, 0.62);
}

.rank-badge {
    top: 12px;
    right: 12px;
    color: var(--white);
    background: linear-gradient(135deg, var(--red-600), var(--amber-600));
}

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

.movie-card-body h3 {
    margin: 0 0 10px;
    color: var(--red-900);
    font-size: 18px;
    line-height: 1.35;
}

.movie-card-body p {
    min-height: 48px;
    margin: 0 0 14px;
    color: var(--gray-700);
    line-height: 1.55;
    font-size: 14px;
}

.movie-meta-line {
    justify-content: space-between;
    gap: 10px;
    color: var(--red-700);
    font-size: 13px;
    font-weight: 650;
}

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

.category-panel,
.category-overview-card,
.detail-card,
.side-card,
.filter-bar {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.category-panel,
.category-overview-card {
    padding: 26px;
}

.category-panel-title,
.category-overview-card h2 a {
    color: var(--red-900);
    font-size: 24px;
    font-weight: 850;
}

.category-panel p,
.category-overview-card p {
    color: var(--gray-700);
    line-height: 1.65;
}

.category-panel ul,
.category-overview-card ul,
.site-footer ul {
    padding: 0;
    margin: 16px 0;
    list-style: none;
}

.category-panel li,
.category-overview-card li {
    padding: 7px 0;
    color: var(--amber-800);
    border-bottom: 1px dashed var(--amber-200);
}

.page-shell,
.detail-shell {
    padding: 30px 0 70px;
}

.page-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 32px;
    padding: 48px;
    color: var(--white);
    background: linear-gradient(135deg, var(--red-600), var(--red-900));
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 45px rgba(127, 29, 29, 0.22);
}

.page-hero::after {
    content: "";
    position: absolute;
    inset: auto -90px -110px auto;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.page-hero h1 {
    position: relative;
    margin: 0 0 12px;
    font-size: clamp(34px, 4vw, 50px);
}

.page-hero p {
    position: relative;
    max-width: 760px;
    margin: 0;
    color: #ffe4e6;
    line-height: 1.7;
}

.ranking-hero {
    background: linear-gradient(135deg, #991b1b, #d97706);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-bottom: 18px;
    color: var(--amber-700);
    font-size: 14px;
}

.breadcrumb a:hover {
    color: var(--red-700);
}

.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
    padding: 18px;
}

.filter-search input,
.large-search input {
    width: min(520px, 100%);
    border: 2px solid var(--amber-200);
    border-radius: 999px;
    outline: 0;
    padding: 13px 18px;
    background: var(--amber-50);
}

.filter-search input:focus,
.large-search input:focus,
.header-search input:focus {
    border-color: var(--amber-600);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-button {
    border: 0;
    border-radius: 999px;
    color: var(--amber-900);
    background: var(--amber-100);
    padding: 10px 14px;
    cursor: pointer;
}

.filter-button.active,
.filter-button:hover {
    color: var(--white);
    background: var(--amber-600);
}

.large-search {
    position: relative;
    margin-top: 24px;
}

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

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

.detail-main {
    min-width: 0;
}

.movie-player {
    position: relative;
    overflow: hidden;
    margin-bottom: 26px;
    aspect-ratio: 16 / 9;
    background: #030712;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.28);
}

.video-element {
    width: 100%;
    height: 100%;
    display: block;
    background: #030712;
}

.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: var(--white);
    background:
        radial-gradient(circle at center, rgba(220, 38, 38, 0.28), transparent 35%),
        rgba(0, 0, 0, 0.48);
    cursor: pointer;
}

.player-overlay strong {
    font-size: 26px;
}

.player-overlay small {
    color: #fde68a;
}

.play-icon {
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--red-600);
    box-shadow: 0 18px 38px rgba(220, 38, 38, 0.35);
}

.movie-player.is-playing .player-overlay {
    display: none;
}

.detail-card {
    padding: 26px;
}

.detail-title-row {
    align-items: flex-start;
    gap: 22px;
    margin-bottom: 28px;
}

.detail-cover {
    width: 220px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    flex: 0 0 auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.detail-card h1 {
    margin: 0 0 12px;
    color: var(--red-900);
    font-size: clamp(28px, 4vw, 42px);
}

.detail-one-line {
    margin: 0 0 18px;
    color: var(--gray-700);
    font-size: 17px;
    line-height: 1.7;
}

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

.detail-meta span {
    display: inline-flex;
    padding: 7px 12px;
    color: var(--amber-900);
    background: var(--amber-100);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 750;
}

.detail-section {
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.detail-section h2,
.side-card h2,
.related-block h2 {
    margin: 0 0 14px;
    color: var(--red-900);
}

.detail-section p {
    margin: 0 0 14px;
    color: var(--gray-700);
    line-height: 1.9;
}

.detail-sidebar {
    min-width: 0;
}

.side-card {
    position: sticky;
    top: 100px;
    padding: 20px;
}

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

.side-related-item {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.side-related-item img {
    width: 112px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
}

.side-related-item strong {
    display: block;
    color: var(--red-900);
    line-height: 1.35;
}

.side-related-item small {
    display: block;
    margin-top: 6px;
    color: var(--gray-500);
}

.related-block {
    padding-bottom: 0;
}

.site-footer {
    color: #fee2e2;
    background: var(--red-900);
}

.footer-inner {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
    padding: 46px 0;
}

.footer-logo {
    color: var(--white);
    font-size: 24px;
}

.footer-brand p,
.site-footer a,
.site-footer li {
    color: #fecaca;
}

.site-footer h2 {
    margin: 0 0 14px;
    color: var(--white);
    font-size: 18px;
}

.site-footer li {
    padding: 5px 0;
}

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

@media (max-width: 1040px) {
    .header-inner {
        flex-wrap: wrap;
        padding: 12px 0;
    }

    .main-nav {
        order: 4;
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px 0;
        border-top: 1px solid var(--amber-200);
    }

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

    .nav-toggle {
        display: inline-block;
        margin-left: auto;
    }

    .header-search {
        margin-left: 0;
        flex: 1 1 100%;
    }

    .header-search input {
        width: 100%;
    }

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

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

    .side-card {
        position: static;
    }
}

@media (max-width: 760px) {
    .brand-text {
        font-size: 20px;
    }

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

    .hero-control {
        display: none;
    }

    .hero-content {
        left: 20px;
        bottom: 62px;
        width: calc(100% - 40px);
    }

    .section-head,
    .filter-bar,
    .detail-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .movie-grid,
    .category-panel-grid,
    .category-overview-grid,
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .page-hero {
        padding: 34px 24px;
    }

    .detail-cover {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .movie-grid {
        gap: 16px;
    }

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

    .side-related-item {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .side-related-item img {
        width: 96px;
    }
}
