* {
    box-sizing: border-box;
}

:root {
    --color-primary: #1a4d6d;
    --color-primary-light: #2d6b8f;
    --color-primary-dark: #0f3347;
    --color-secondary: #d4a574;
    --color-secondary-light: #e6c9a0;
    --color-secondary-dark: #b8864d;
    --color-accent: #4a90a4;
    --color-accent-light: #6db3c7;
    --color-accent-dark: #2f6d7f;
    --color-bg-primary: #0a1929;
    --color-bg-secondary: #132f4c;
    --color-bg-tertiary: #1e3a52;
    --color-text-primary: #e7edf3;
    --color-text-secondary: #b2bac2;
    --color-text-muted: #7a8189;
    --color-border: #2d3e50;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body.menu-open {
    overflow: hidden;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 25, 41, 0.62);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
    background: rgba(10, 25, 41, 0.96);
    box-shadow: var(--shadow-lg);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    gap: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 800;
    color: var(--color-text-primary);
    white-space: nowrap;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    color: #102033;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-accent-light));
    box-shadow: 0 8px 24px rgba(74, 144, 164, 0.35);
}

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

.desktop-nav a,
.mobile-panel a,
.footer-links a {
    color: var(--color-text-secondary);
    transition: color 0.2s ease, background 0.2s ease;
}

.desktop-nav a:hover,
.mobile-panel a:hover,
.footer-links a:hover {
    color: var(--color-accent-light);
}

.header-search-form {
    display: flex;
    align-items: center;
    min-width: 300px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(19, 47, 76, 0.74);
}

.header-search-form input {
    width: 100%;
    border: 0;
    outline: 0;
    padding: 10px 14px;
    color: var(--color-text-primary);
    background: transparent;
}

.header-search-form button,
.big-search-form button {
    border: 0;
    color: white;
    background: var(--color-accent);
    padding: 10px 18px;
    transition: background 0.2s ease;
}

.header-search-form button:hover,
.big-search-form button:hover {
    background: var(--color-accent-light);
}

.menu-toggle {
    display: none;
    border: 0;
    color: var(--color-text-primary);
    background: transparent;
    font-size: 28px;
}

.mobile-panel {
    display: none;
    padding: 0 16px 18px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
}

.mobile-panel a {
    display: block;
    padding: 12px 4px;
}

.home-hero {
    position: relative;
    height: 78vh;
    min-height: 620px;
    overflow: hidden;
}

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

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

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

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

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 45%, rgba(74, 144, 164, 0.28), transparent 34%),
        linear-gradient(90deg, rgba(10, 25, 41, 0.96) 0%, rgba(10, 25, 41, 0.68) 42%, rgba(10, 25, 41, 0.18) 100%),
        linear-gradient(0deg, var(--color-bg-primary) 0%, transparent 38%);
}

.hero-content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding-bottom: 90px;
}

.hero-copy {
    width: min(720px, 92vw);
    animation: slideUp 0.65s ease both;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--color-secondary);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-copy h1,
.hero-copy h2,
.page-hero h1,
.detail-copy h1 {
    margin: 0;
    font-size: clamp(36px, 6vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero-copy p,
.page-hero p,
.detail-lead {
    margin: 20px 0 0;
    color: var(--color-text-secondary);
    font-size: clamp(16px, 2vw, 20px);
}

.hero-tags,
.detail-meta,
.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--color-text-secondary);
}

.hero-tags {
    margin: 24px 0 0;
}

.hero-tags span,
.detail-meta span {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(19, 47, 76, 0.62);
}

.hero-actions,
.section-heading,
.inline-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.hero-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 30px;
}

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

.primary-btn {
    color: white;
    background: var(--color-accent);
    box-shadow: var(--shadow-md);
}

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

.primary-btn:hover {
    background: var(--color-accent-light);
    box-shadow: var(--shadow-lg);
}

.ghost-btn {
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    background: rgba(19, 47, 76, 0.72);
}

.hero-controls {
    position: absolute;
    left: 50%;
    bottom: 34px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 5;
}

.hero-dot {
    width: 38px;
    height: 4px;
    border: 0;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.35);
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
    width: 58px;
    background: var(--color-secondary);
}

.search-strip,
.surface-section {
    background: var(--color-bg-secondary);
}

.search-strip-inner {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 1.1fr);
    gap: 26px;
    align-items: center;
    padding: 34px 0;
}

.search-strip h2,
.section-heading h2,
.ranking-panel h2,
.prose-card h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.18;
}

.big-search-form {
    display: flex;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-bg-tertiary);
    box-shadow: var(--shadow-sm);
}

.big-search-form input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 18px;
    color: var(--color-text-primary);
    background: transparent;
}

.big-search-form button {
    padding: 0 28px;
}

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

.section-heading {
    margin-bottom: 28px;
}

.section-heading a {
    color: var(--color-accent-light);
    font-weight: 700;
}

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.shortcut-card {
    position: relative;
    min-height: 150px;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: var(--color-bg-secondary);
    box-shadow: var(--shadow-md);
}

.shortcut-card img {
    width: 100%;
    height: 100%;
    min-height: 150px;
    object-fit: cover;
    opacity: 0.7;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.shortcut-card:hover img {
    transform: scale(1.06);
    opacity: 0.9;
}

.shortcut-card span {
    position: absolute;
    left: 18px;
    bottom: 16px;
    z-index: 2;
    font-size: 22px;
    font-weight: 800;
    text-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

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

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

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

.related-grid {
    grid-template-columns: repeat(6, 1fr);
}

.movie-card {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-xl);
    background: var(--color-bg-secondary);
    box-shadow: var(--shadow-sm);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.movie-card:hover {
    transform: translateY(-8px);
    border-color: rgba(109, 179, 199, 0.38);
    box-shadow: var(--shadow-xl);
}

.poster-wrap {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--color-bg-tertiary);
}

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

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

.year-badge,
.type-badge,
.rank-badge {
    position: absolute;
    z-index: 2;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.year-badge {
    top: 10px;
    left: 10px;
    background: rgba(10, 25, 41, 0.72);
}

.type-badge {
    right: 10px;
    bottom: 10px;
    color: #0a1929;
    background: var(--color-secondary);
}

.rank-badge {
    left: 10px;
    bottom: 10px;
    background: var(--color-accent);
}

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

.movie-card h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
    min-height: 46px;
}

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

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

.card-meta {
    gap: 8px;
    min-height: 40px;
    color: var(--color-text-muted);
    font-size: 12px;
}

.card-meta span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag-list span {
    padding: 4px 8px;
    border-radius: 8px;
    color: var(--color-text-secondary);
    background: var(--color-bg-tertiary);
    font-size: 12px;
}

.two-column-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
    align-items: start;
}

.ranking-panel {
    position: sticky;
    top: 96px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-xl);
    background: rgba(10, 25, 41, 0.32);
    box-shadow: var(--shadow-md);
}

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

.rank-row {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 10px 14px;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    background: rgba(30, 58, 82, 0.72);
    transition: background 0.2s ease, transform 0.2s ease;
}

.rank-row:hover {
    background: rgba(74, 144, 164, 0.25);
    transform: translateX(4px);
}

.rank-row span {
    grid-row: span 2;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #0a1929;
    background: var(--color-secondary);
    font-weight: 900;
}

.rank-row strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.rank-row em {
    color: var(--color-text-muted);
    font-style: normal;
    font-size: 13px;
}

.page-hero,
.detail-hero {
    position: relative;
    padding: 140px 0 70px;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 20%, rgba(74, 144, 164, 0.28), transparent 32%),
        linear-gradient(135deg, var(--color-bg-primary), var(--color-bg-secondary));
}

.slim-hero {
    padding-bottom: 54px;
}

.page-hero-inner {
    max-width: 850px;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(150px, 0.7fr));
    gap: 14px;
    margin-bottom: 28px;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-bg-secondary);
    box-shadow: var(--shadow-sm);
}

.filter-panel label {
    display: grid;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: 13px;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    outline: 0;
    padding: 0 12px;
    color: var(--color-text-primary);
    background: var(--color-bg-tertiary);
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: var(--color-accent-light);
    box-shadow: 0 0 0 3px rgba(109, 179, 199, 0.16);
}

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

.category-card {
    display: grid;
    gap: 18px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-xl);
    background: var(--color-bg-secondary);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.category-card h2 {
    margin: 0 0 8px;
}

.category-card p {
    margin: 0;
    color: var(--color-text-secondary);
}

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

.category-thumbs img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px;
}

.detail-hero-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 42px;
    align-items: center;
}

.detail-poster {
    overflow: hidden;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
    color: var(--color-text-muted);
}

.breadcrumb a:hover {
    color: var(--color-accent-light);
}

.detail-meta {
    margin-top: 22px;
}

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

.watch-section {
    padding: 72px 0;
    background: #06111d;
}

.player-shell {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    background: #000;
    box-shadow: var(--shadow-xl);
}

.player-shell video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.player-cover {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 0;
    padding: 26px;
    color: white;
    text-align: center;
    background:
        linear-gradient(0deg, rgba(10, 25, 41, 0.84), rgba(10, 25, 41, 0.22)),
        rgba(0, 0, 0, 0.38);
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-circle {
    display: inline-grid;
    place-items: center;
    width: 84px;
    height: 84px;
    border-radius: 999px;
    color: #102033;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-accent-light));
    font-size: 34px;
    box-shadow: 0 12px 34px rgba(74, 144, 164, 0.36);
}

.player-cover strong {
    max-width: 760px;
    font-size: clamp(24px, 4vw, 44px);
    line-height: 1.12;
}

.player-cover small {
    max-width: 760px;
    color: var(--color-text-secondary);
    font-size: 16px;
}

.detail-text-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.prose-card {
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-xl);
    background: var(--color-bg-secondary);
    box-shadow: var(--shadow-sm);
}

.prose-card p {
    margin: 16px 0 0;
    color: var(--color-text-secondary);
    font-size: 17px;
}

.site-footer {
    padding: 56px 0 24px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-primary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 36px;
}

.footer-brand {
    margin-bottom: 16px;
}

.site-footer p {
    max-width: 720px;
    margin: 0;
    color: var(--color-text-secondary);
}

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

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
}

.footer-bottom {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--color-text-muted);
    font-size: 14px;
}

.is-hidden-card {
    display: none !important;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1180px) {
    .desktop-nav,
    .nav-inner > .header-search-form {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .mobile-panel.is-open {
        display: block;
    }

    .two-column-layout,
    .detail-hero-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .ranking-panel {
        position: static;
    }

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

    .compact-grid,
    .shortcut-grid,
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .container {
        width: min(100% - 22px, 1400px);
    }

    .home-hero {
        min-height: 560px;
        height: 76vh;
    }

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

    .hero-actions,
    .section-heading,
    .inline-heading,
    .search-strip-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-strip-inner,
    .filter-panel,
    .detail-text-grid {
        grid-template-columns: 1fr;
    }

    .big-search-form {
        width: 100%;
        flex-direction: column;
        border-radius: 14px;
    }

    .big-search-form button {
        min-height: 48px;
    }

    .section-block,
    .watch-section {
        padding: 50px 0;
    }

    .page-hero,
    .detail-hero {
        padding: 118px 0 48px;
    }

    .movie-grid,
    .listing-grid,
    .compact-grid,
    .related-grid,
    .shortcut-grid,
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

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

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

    .movie-card p,
    .card-meta,
    .tag-list {
        display: none;
    }

    .detail-poster {
        max-width: 260px;
    }

    .player-cover small {
        display: none;
    }

    .play-circle {
        width: 68px;
        height: 68px;
        font-size: 28px;
    }
}

@media (max-width: 420px) {
    .movie-grid,
    .listing-grid,
    .compact-grid,
    .related-grid,
    .shortcut-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }

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