:root {
    --paper-50: #fafaf9;
    --paper-100: #f5f5f4;
    --paper-200: #e7e5e4;
    --paper-300: #d6d3d1;
    --paper-400: #a8a29e;
    --paper-500: #78716c;
    --ink-900: #3d3d3d;
    --ink-800: #44403c;
    --ink-700: #4f4f4f;
    --ink-600: #5d5d5d;
    --ink-500: #6d6d6d;
    --primary-50: #f0f9f4;
    --primary-100: #dcf2e4;
    --primary-200: #bce5cd;
    --primary-400: #5ab889;
    --primary-600: #267f56;
    --primary-700: #1f6546;
    --accent-50: #fff8eb;
    --accent-100: #fcefd0;
    --accent-500: #df8122;
    --accent-600: #cf6913;
    --accent-700: #9f4d11;
    --shadow: 0 12px 30px rgba(61, 61, 61, 0.1);
    --shadow-lg: 0 24px 60px rgba(61, 61, 61, 0.16);
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper-50);
    color: var(--ink-900);
    font-family: "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--primary-100);
    box-shadow: 0 4px 20px rgba(61, 61, 61, 0.06);
    backdrop-filter: blur(8px);
}

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

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand-icon,
.footer-brand span {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: var(--primary-600);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 8px 20px rgba(38, 127, 86, 0.28);
}

.brand-copy {
    display: grid;
    gap: 0;
}

.brand-copy strong,
.footer-brand strong {
    font-family: Georgia, Cambria, "Times New Roman", Times, serif;
    font-size: 20px;
    color: var(--ink-900);
    transition: color 0.2s ease;
}

.brand-copy small {
    color: var(--ink-500);
    font-size: 12px;
}

.brand:hover strong,
.desktop-nav a:hover {
    color: var(--primary-700);
}

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

.desktop-nav a {
    position: relative;
    color: var(--ink-700);
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.desktop-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -22px;
    height: 2px;
    background: var(--primary-600);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.desktop-nav a:hover::after {
    transform: scaleX(1);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: var(--primary-50);
    color: var(--primary-700);
}

.mobile-nav {
    display: none;
    padding: 12px 20px 18px;
    border-top: 1px solid var(--primary-100);
    background: #fff;
}

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

.mobile-nav a {
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--ink-700);
    font-weight: 600;
}

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

.hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    max-height: 800px;
    overflow: hidden;
    background: var(--ink-900);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    background-position: center;
    background-size: cover;
    filter: brightness(0.72);
    transform: scale(1.02);
    transition: opacity 0.9s ease, transform 1.4s ease;
}

.hero-slide.is-active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.12));
}

.hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
}

.hero-copy {
    width: min(680px, 100%);
    color: #fff;
}

.hero-copy h1,
.page-hero h1,
.detail-info h1 {
    margin: 0 0 16px;
    font-family: Georgia, Cambria, "Times New Roman", Times, serif;
    line-height: 1.08;
    font-weight: 800;
}

.hero-copy h1 {
    font-size: clamp(44px, 7vw, 72px);
}

.hero-copy > p {
    margin: 0 0 18px;
    color: var(--paper-200);
    font-size: clamp(18px, 2.6vw, 26px);
    font-weight: 300;
}

.hero-copy .lead {
    max-width: 620px;
    margin-bottom: 28px;
    color: var(--paper-300);
    font-size: 18px;
}

.hero-card {
    display: none;
    width: min(560px, 100%);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-lg);
}

.hero-card.is-active {
    display: block;
}

.hero-card h2 {
    margin: 0 0 8px;
    color: #fff;
    font-family: Georgia, Cambria, "Times New Roman", Times, serif;
    font-size: 28px;
}

.hero-card p {
    margin: 0 0 18px;
    color: var(--paper-200);
}

.hero-actions,
.form-row,
.filter-row,
.pill-row,
.meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

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

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

.btn-primary {
    background: var(--primary-600);
    color: #fff;
    box-shadow: 0 12px 24px rgba(38, 127, 86, 0.28);
}

.btn-primary:hover {
    background: var(--primary-700);
}

.btn-light {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero-control {
    position: absolute;
    z-index: 3;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 28px;
    backdrop-filter: blur(8px);
    transition: background 0.2s ease;
}

.hero-control:hover {
    background: rgba(255, 255, 255, 0.32);
}

.hero-prev {
    left: 18px;
}

.hero-next {
    right: 18px;
}

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

.hero-dots button {
    width: 42px;
    height: 4px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    transition: background 0.2s ease, width 0.2s ease;
}

.hero-dots button.is-active {
    width: 62px;
    background: #fff;
}

.content-wrap {
    padding: 64px 0;
}

.section-block {
    margin-bottom: 72px;
}

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

.section-header.center {
    display: block;
    text-align: center;
}

.section-header h2,
.panel h2,
.detail-info h2,
.side-panel h2,
.category-card h2 {
    margin: 0 0 8px;
    color: var(--ink-900);
    font-family: Georgia, Cambria, "Times New Roman", Times, serif;
    font-weight: 800;
    line-height: 1.2;
}

.section-header h2 {
    font-size: clamp(28px, 4vw, 42px);
}

.section-header p,
.page-hero p,
.category-card p,
.panel p {
    margin: 0;
    color: var(--ink-600);
}

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

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

.movie-card,
.featured-card,
.category-card,
.panel,
.side-panel {
    background: #fff;
    box-shadow: var(--shadow);
}

.movie-card,
.featured-card,
.category-card,
.side-card,
.rank-item {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card {
    display: block;
    overflow: hidden;
    border-radius: 16px;
}

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

.movie-card-image,
.featured-image {
    position: relative;
    overflow: hidden;
    background: var(--ink-900);
}

.movie-card-image {
    aspect-ratio: 4 / 3;
}

.featured-image {
    aspect-ratio: 16 / 9;
}

.movie-card-image img,
.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.movie-card:hover img,
.featured-card:hover img {
    transform: scale(1.08);
}

.movie-card-image::after,
.featured-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), transparent 62%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.movie-card:hover .movie-card-image::after,
.featured-card:hover .featured-image::after {
    opacity: 1;
}

.movie-card-play,
.play-badge {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--primary-600);
    color: #fff;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card-play {
    width: 48px;
    height: 48px;
}

.play-badge {
    width: 64px;
    height: 64px;
    font-size: 22px;
}

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

.movie-card-year {
    position: absolute;
    z-index: 3;
    right: 10px;
    top: 10px;
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(61, 61, 61, 0.82);
    color: #fff;
    font-size: 12px;
}

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

.movie-card h3,
.featured-card h3 {
    margin: 10px 0 8px;
    color: var(--ink-900);
    font-family: Georgia, Cambria, "Times New Roman", Times, serif;
    line-height: 1.25;
    transition: color 0.2s ease;
}

.movie-card h3 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
}

.featured-card h3 {
    font-size: 30px;
}

.movie-card:hover h3,
.featured-card:hover h3 {
    color: var(--primary-700);
}

.movie-card p,
.featured-card p {
    display: -webkit-box;
    margin: 0 0 14px;
    overflow: hidden;
    color: var(--ink-600);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.featured-card {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    overflow: hidden;
    border-radius: 18px;
}

.featured-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
}

.pill-row span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--primary-100);
    color: var(--primary-700);
    font-size: 13px;
    font-weight: 700;
}

.pill-row span:nth-child(even) {
    background: var(--accent-100);
    color: var(--accent-700);
}

.pill-row.small span {
    min-height: 22px;
    padding: 0 8px;
    font-size: 12px;
}

.meta-row {
    color: var(--ink-500);
    font-size: 14px;
}

.meta-row.compact {
    justify-content: space-between;
    font-size: 12px;
}

.category-panel {
    padding: 30px;
    border-radius: 28px;
    background: linear-gradient(135deg, var(--primary-50), var(--accent-50));
}

.category-links,
.category-grid {
    display: grid;
    gap: 18px;
}

.category-links {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 28px;
}

.category-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 78px;
    padding: 18px;
    border-radius: 18px;
    background: #fff;
    color: var(--ink-800);
    box-shadow: 0 8px 24px rgba(61, 61, 61, 0.08);
}

.category-chip strong {
    display: block;
    color: var(--ink-900);
}

.category-chip small {
    color: var(--ink-500);
}

.category-chip:hover {
    color: var(--primary-700);
    transform: translateY(-2px);
}

.page-hero {
    background: linear-gradient(90deg, var(--primary-600), var(--accent-600));
    color: #fff;
    padding: 72px 0;
}

.page-hero h1 {
    font-size: clamp(38px, 6vw, 58px);
}

.page-hero p {
    max-width: 760px;
    color: var(--primary-100);
    font-size: 20px;
}

.catalog-tools {
    position: sticky;
    top: 78px;
    z-index: 10;
    margin-bottom: 30px;
    padding: 18px;
    border: 1px solid var(--primary-100);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.search-input,
.select-input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--primary-200);
    border-radius: 14px;
    background: #fff;
    color: var(--ink-900);
    outline: none;
}

.search-input {
    flex: 1 1 260px;
    padding: 0 16px;
}

.select-input {
    flex: 0 1 180px;
    padding: 0 12px;
}

.search-input:focus,
.select-input:focus {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 4px rgba(38, 127, 86, 0.12);
}

.filter-row {
    margin-top: 14px;
}

.filter-button {
    border: 0;
    border-radius: 999px;
    background: var(--paper-100);
    color: var(--ink-700);
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease;
}

.filter-button.is-active,
.filter-button:hover {
    background: var(--primary-600);
    color: #fff;
}

.empty-state {
    display: none;
    padding: 40px;
    border-radius: 18px;
    background: #fff;
    color: var(--ink-600);
    text-align: center;
    box-shadow: var(--shadow);
}

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

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

.category-card {
    position: relative;
    overflow: hidden;
    min-height: 250px;
    padding: 24px;
    border-radius: 22px;
}

.category-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
    transition: transform 0.5s ease, opacity 0.2s ease;
}

.category-card:hover img {
    opacity: 0.28;
    transform: scale(1.08);
}

.category-card-body {
    position: relative;
    z-index: 2;
}

.category-card h2 {
    font-size: 24px;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 52px 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border: 1px solid var(--primary-100);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(61, 61, 61, 0.06);
}

.rank-item:hover {
    border-color: var(--primary-200);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.rank-number {
    color: var(--primary-600);
    font-family: Georgia, Cambria, "Times New Roman", Times, serif;
    font-size: 26px;
    font-weight: 800;
    text-align: center;
}

.rank-item img {
    width: 72px;
    height: 54px;
    border-radius: 12px;
    object-fit: cover;
}

.rank-info {
    min-width: 0;
}

.rank-info strong,
.rank-info em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-info strong {
    color: var(--ink-900);
}

.rank-info em {
    color: var(--ink-500);
    font-size: 13px;
    font-style: normal;
}

.rank-score {
    color: var(--accent-700);
    font-weight: 800;
}

.detail-wrap {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 28px;
    padding: 36px 0 70px;
}

.player-root {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    background: var(--ink-900);
    box-shadow: var(--shadow-lg);
}

.player-root video {
    width: 100%;
    height: 100%;
    background: #000;
}

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background-position: center;
    background-size: cover;
}

.player-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.2));
}

.player-cover[hidden] {
    display: none;
}

.player-start {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border: 0;
    border-radius: 999px;
    background: var(--primary-600);
    color: #fff;
    font-size: 28px;
    box-shadow: 0 18px 45px rgba(38, 127, 86, 0.34);
    transition: transform 0.2s ease, background 0.2s ease;
}

.player-start:hover {
    background: var(--primary-700);
    transform: scale(1.04);
}

.detail-info,
.side-panel,
.panel {
    border-radius: 18px;
}

.detail-info,
.side-panel {
    padding: 26px;
}

.detail-info {
    margin-top: 24px;
}

.detail-info h1 {
    font-size: clamp(30px, 4vw, 44px);
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-bottom: 20px;
    color: var(--ink-600);
    font-size: 14px;
}

.detail-tags {
    margin-bottom: 24px;
}

.detail-section {
    padding-top: 22px;
    border-top: 1px solid var(--primary-100);
}

.detail-section p {
    color: var(--ink-700);
    font-size: 17px;
    line-height: 1.85;
}

.breadcrumb {
    margin: 0 0 18px;
    color: var(--ink-500);
    font-size: 14px;
}

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

.side-panel {
    position: sticky;
    top: 88px;
}

.side-card {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--primary-100);
}

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

.side-card:hover {
    color: var(--primary-700);
}

.side-card img {
    width: 90px;
    height: 66px;
    border-radius: 12px;
    object-fit: cover;
}

.side-card strong,
.side-card em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-card em {
    color: var(--ink-500);
    font-size: 13px;
    font-style: normal;
}

.site-footer {
    margin-top: 60px;
    background: var(--ink-900);
    color: var(--paper-200);
}

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

.footer-brand strong,
.site-footer h2 {
    color: #fff;
}

.site-footer p {
    max-width: 460px;
    color: var(--paper-300);
}

.site-footer a {
    display: block;
    margin: 8px 0;
    color: var(--paper-300);
    font-size: 14px;
}

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

.footer-bottom {
    padding: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--paper-400);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 1024px) {
    .movie-grid,
    .category-links,
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .featured-card,
    .detail-wrap,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .side-panel {
        position: static;
    }
}

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

    .menu-toggle {
        display: inline-grid;
        place-items: center;
    }

    .brand-copy small {
        display: none;
    }

    .hero {
        min-height: 560px;
    }

    .hero-control {
        display: none;
    }

    .hero-card {
        padding: 20px;
    }

    .content-wrap {
        padding: 44px 0;
    }

    .section-header {
        display: block;
    }

    .section-header .btn {
        margin-top: 14px;
    }

    .catalog-tools {
        position: relative;
        top: auto;
    }

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

    .rank-score {
        grid-column: 3;
        justify-self: start;
    }
}

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

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

    .page-hero {
        padding: 52px 0;
    }

    .footer-grid {
        gap: 22px;
    }
}
