* {
    box-sizing: border-box;
}

:root {
    --primary-50: #fdf8f3;
    --primary-100: #faeee1;
    --primary-300: #ecbe98;
    --primary-600: #c8643e;
    --primary-700: #a94d2c;
    --primary-800: #854132;
    --primary-900: #6c372b;
    --accent-400: #f59d53;
    --accent-600: #dd4f16;
    --accent-700: #b73a14;
    --secondary-50: #f7f7f6;
    --secondary-100: #e4e4e2;
    --secondary-200: #c9c8c5;
    --secondary-400: #908d88;
    --secondary-600: #6d6963;
    --secondary-800: #474542;
    --secondary-900: #343332;
    --secondary-950: #1c1c1b;
    --white: #ffffff;
    --black: #000000;
    --radius: 18px;
    --shadow: 0 16px 40px rgba(52, 51, 50, 0.16);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--secondary-50);
    color: var(--secondary-900);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    color: var(--primary-50);
    background: linear-gradient(90deg, var(--primary-900), var(--primary-800), var(--primary-900));
    box-shadow: 0 12px 30px rgba(28, 28, 27, 0.22);
}

.header-inner {
    width: min(1180px, calc(100% - 32px));
    height: 70px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: max-content;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background: var(--accent-600);
    box-shadow: 0 8px 20px rgba(221, 79, 22, 0.35);
}

.brand strong {
    display: block;
    font-size: 20px;
    line-height: 1.1;
    letter-spacing: 0.04em;
}

.brand em {
    display: block;
    margin-top: 2px;
    color: var(--primary-300);
    font-size: 12px;
    font-style: normal;
}

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

.desktop-nav a,
.nav-dropdown button {
    color: var(--primary-50);
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    transition: color 0.2s ease;
}

.desktop-nav a:hover,
.nav-dropdown button:hover {
    color: var(--accent-400);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    width: 180px;
    padding: 8px 0;
    border-radius: 14px;
    background: var(--white);
    color: var(--secondary-900);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--secondary-900);
}

.nav-dropdown-menu a:hover {
    color: var(--primary-700);
    background: var(--primary-50);
}

.top-search {
    display: flex;
    align-items: center;
    min-width: 300px;
}

.top-search input,
.mobile-panel input,
.filter-input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--primary-50);
    background: rgba(253, 248, 243, 0.12);
    border-radius: 12px 0 0 12px;
    padding: 12px 14px;
}

.top-search input::placeholder,
.mobile-panel input::placeholder {
    color: var(--primary-300);
}

.top-search button,
.mobile-panel button,
.hero-button,
.link-button,
.filter-button,
.player-start {
    border: 0;
    cursor: pointer;
    color: var(--white);
    background: var(--accent-600);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.top-search button,
.mobile-panel button {
    padding: 12px 16px;
    border-radius: 0 12px 12px 0;
}

.top-search button:hover,
.mobile-panel button:hover,
.hero-button:hover,
.link-button:hover,
.filter-button:hover,
.player-start:hover {
    background: var(--accent-700);
}

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    color: var(--primary-50);
    border: 0;
    border-radius: 12px;
    background: rgba(253, 248, 243, 0.12);
    font-size: 22px;
}

.mobile-panel {
    display: none;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 16px 0 20px;
    border-top: 1px solid rgba(253, 248, 243, 0.14);
}

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

.mobile-panel form {
    display: flex;
}

.mobile-panel a {
    padding: 8px 0;
    color: var(--primary-50);
}

main {
    min-height: 60vh;
}

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

.hero {
    position: relative;
    height: 560px;
    overflow: hidden;
    background: var(--secondary-950);
}

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

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

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

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.2));
}

.hero-content {
    position: absolute;
    left: 50%;
    right: auto;
    bottom: 0;
    z-index: 2;
    width: min(1180px, calc(100% - 32px));
    padding: 0 0 64px;
    transform: translateX(-50%);
    color: var(--white);
}

.hero-label,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 999px;
    color: var(--white);
    background: var(--accent-600);
    font-size: 13px;
    font-weight: 750;
}

.hero h1,
.hero h2 {
    max-width: 780px;
    margin: 18px 0 16px;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.06;
    letter-spacing: -0.04em;
}

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

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

.hero-button,
.link-button,
.filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 12px;
    font-weight: 750;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    color: var(--white);
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(10px);
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    color: var(--white);
    background: rgba(0, 0, 0, 0.48);
    cursor: pointer;
    transform: translateY(-50%);
}

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

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

.hero-dots button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.42);
    cursor: pointer;
}

.hero-dots button.is-active {
    width: 28px;
    background: var(--accent-600);
}

.section {
    padding: 54px 0;
}

.section-muted {
    background: var(--white);
}

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

.section-kicker {
    margin: 0 0 8px;
    color: var(--accent-700);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section h2,
.page-title h1 {
    margin: 0;
    color: var(--secondary-900);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.12;
}

.section-head p,
.page-title p {
    max-width: 740px;
    margin: 10px 0 0;
    color: var(--secondary-600);
}

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

.movie-card {
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 10px 28px rgba(52, 51, 50, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.poster {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-900), var(--accent-700));
}

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

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

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.76));
}

.poster-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 9px;
    border-radius: 999px;
    color: var(--white);
    background: rgba(221, 79, 22, 0.92);
    font-size: 12px;
    font-weight: 750;
}

.poster-play {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    color: var(--white);
    background: rgba(0, 0, 0, 0.54);
    font-size: 13px;
    font-weight: 750;
}

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

.movie-meta-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--secondary-600);
    font-size: 13px;
}

.movie-meta-line a {
    color: var(--primary-700);
    font-weight: 750;
}

.movie-card h3 {
    margin: 8px 0 8px;
    font-size: 18px;
    line-height: 1.35;
}

.movie-card h3 a:hover {
    color: var(--accent-700);
}

.movie-card p {
    display: -webkit-box;
    min-height: 44px;
    margin: 0;
    overflow: hidden;
    color: var(--secondary-600);
    font-size: 14px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
}

.tag-row span {
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--primary-800);
    background: var(--primary-50);
    font-size: 12px;
}

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

.category-tile {
    position: relative;
    min-height: 190px;
    overflow: hidden;
    border-radius: var(--radius);
    padding: 24px;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-900), var(--primary-700), var(--accent-700));
    box-shadow: var(--shadow);
}

.category-tile::after {
    content: "";
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.category-tile h2,
.category-tile h3 {
    position: relative;
    margin: 0 0 10px;
    font-size: 24px;
}

.category-tile p {
    position: relative;
    margin: 0 0 20px;
    color: rgba(255, 255, 255, 0.82);
}

.category-tile span {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.16);
    font-weight: 750;
}

.page-title {
    padding: 48px 0 22px;
}

.filter-panel {
    display: grid;
    grid-template-columns: 1fr 180px 180px auto;
    gap: 12px;
    margin: 22px 0 30px;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 10px 28px rgba(52, 51, 50, 0.08);
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--secondary-100);
    border-radius: 12px;
    padding: 0 12px;
    color: var(--secondary-900);
    background: var(--secondary-50);
    outline: none;
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: var(--accent-600);
    box-shadow: 0 0 0 3px rgba(221, 79, 22, 0.12);
}

.empty-state {
    display: none;
    padding: 28px;
    border-radius: var(--radius);
    text-align: center;
    color: var(--secondary-600);
    background: var(--white);
}

.empty-state.is-visible {
    display: block;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 64px 90px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 10px 26px rgba(52, 51, 50, 0.08);
}

.rank-num {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--white);
    background: var(--accent-600);
    font-weight: 850;
}

.rank-cover {
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-900), var(--accent-700));
}

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

.rank-main h2,
.rank-main h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.rank-main p {
    margin: 0;
    color: var(--secondary-600);
}

.rank-heat {
    min-width: 86px;
    text-align: right;
    color: var(--accent-700);
    font-size: 22px;
    font-weight: 850;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 28px 0 18px;
    color: var(--secondary-600);
    font-size: 14px;
}

.breadcrumb a {
    color: var(--primary-700);
    font-weight: 700;
}

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

.detail-main,
.detail-sidebar-card {
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 10px 28px rgba(52, 51, 50, 0.08);
}

.player {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--black);
}

.player video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--black);
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.42));
    pointer-events: none;
}

.player-start {
    width: 82px;
    height: 82px;
    border-radius: 999px;
    font-size: 18px;
    font-weight: 850;
    pointer-events: auto;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.38);
}

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

.detail-content {
    padding: 28px;
}

.detail-content h1 {
    margin: 12px 0 16px;
    font-size: clamp(30px, 5vw, 44px);
    line-height: 1.12;
}

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

.detail-meta span,
.detail-meta a {
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--primary-800);
    background: var(--primary-50);
    font-size: 13px;
    font-weight: 750;
}

.detail-meta a {
    color: var(--white);
    background: var(--accent-600);
}

.detail-section {
    margin-top: 28px;
}

.detail-section h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.detail-section p {
    margin: 0;
    color: var(--secondary-700, #55504b);
}

.detail-sidebar-card {
    padding: 20px;
}

.detail-sidebar-card h2 {
    margin: 0 0 16px;
    font-size: 22px;
}

.side-card {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--secondary-100);
}

.side-card:last-child {
    border-bottom: 0;
}

.side-card img {
    width: 72px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-900), var(--accent-700));
}

.side-card h3 {
    margin: 0 0 6px;
    font-size: 16px;
    line-height: 1.35;
}

.side-card p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--secondary-600);
    font-size: 13px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.site-footer {
    color: var(--secondary-400);
    background: var(--secondary-950);
}

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

.footer-logo {
    margin-bottom: 12px;
    color: var(--primary-50);
    font-size: 22px;
    font-weight: 850;
}

.site-footer h3 {
    margin: 0 0 14px;
    color: var(--primary-50);
    font-size: 17px;
}

.site-footer p {
    max-width: 440px;
    margin: 0;
}

.site-footer a {
    display: block;
    margin: 8px 0;
    transition: color 0.2s ease;
}

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

.footer-bottom {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
}

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

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

    .top-search {
        min-width: 220px;
    }

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

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

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

@media (max-width: 820px) {
    .header-inner {
        height: 64px;
    }

    .top-search {
        display: none;
    }

    .hero {
        height: 520px;
    }

    .hero-content {
        padding-bottom: 58px;
    }

    .hero-control {
        display: none;
    }

    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

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

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

    .filter-panel {
        grid-template-columns: 1fr;
    }

    .rank-item {
        grid-template-columns: 46px 76px 1fr;
    }

    .rank-heat {
        grid-column: 3;
        min-width: 0;
        text-align: left;
        font-size: 18px;
    }

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

@media (max-width: 520px) {
    .brand strong {
        font-size: 18px;
    }

    .brand em {
        display: none;
    }

    .hero h1,
    .hero h2 {
        font-size: 34px;
    }

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

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

    .detail-content {
        padding: 20px;
    }
}
