:root {
    --bg: #020617;
    --bg-soft: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.78);
    --border: rgba(148, 163, 184, 0.18);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent: #2dd4bf;
    --accent-2: #67e8f9;
    --danger: #f97316;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 0%, rgba(45, 212, 191, 0.18), transparent 28rem),
        radial-gradient(circle at 82% 12%, rgba(103, 232, 249, 0.12), transparent 26rem),
        var(--bg);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

img {
    max-width: 100%;
}

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

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

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.brand-text,
.footer-brand {
    font-size: 24px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 14px;
    color: #001f1d;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 28px rgba(45, 212, 191, 0.35);
}

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

.nav-link,
.mobile-link {
    color: #cbd5e1;
    font-weight: 700;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
    color: var(--accent);
}

.header-search,
.mobile-search,
.hero-search {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-search input,
.mobile-search input,
.hero-search input,
.filter-controls input,
.filter-controls select {
    min-width: 0;
    border: 1px solid var(--border);
    color: var(--text);
    background: rgba(15, 23, 42, 0.72);
    border-radius: 999px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input {
    width: 210px;
    padding: 11px 16px;
}

.header-search input:focus,
.mobile-search input:focus,
.hero-search input:focus,
.filter-controls input:focus,
.filter-controls select:focus {
    border-color: rgba(45, 212, 191, 0.78);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.14);
}

.header-search button,
.mobile-search button,
.hero-search button,
.primary-button,
.outline-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.header-search button,
.mobile-search button,
.hero-search button,
.primary-button {
    color: #042f2e;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 16px 34px rgba(20, 184, 166, 0.25);
}

.header-search button,
.mobile-search button {
    padding: 10px 16px;
}

.primary-button,
.ghost-button,
.outline-button {
    padding: 13px 22px;
}

.header-search button:hover,
.mobile-search button:hover,
.hero-search button:hover,
.primary-button:hover,
.ghost-button:hover,
.outline-button:hover {
    transform: translateY(-1px);
}

.ghost-button,
.outline-button {
    color: #dbeafe;
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.58);
}

.ghost-button:hover,
.outline-button:hover {
    border-color: rgba(45, 212, 191, 0.5);
    color: var(--accent);
}

.menu-button {
    display: none;
    width: 44px;
    height: 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.7);
}

.menu-button span {
    width: 20px;
    height: 2px;
    background: currentColor;
}

.mobile-panel {
    display: none;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 18px;
}

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

.mobile-panel nav {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.mobile-search input,
.hero-search input {
    flex: 1;
    padding: 13px 18px;
}

.hero-carousel {
    position: relative;
    min-height: 720px;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    background-size: cover;
    background-position: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

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

.hero-content {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 180px 0 170px;
}

.hero-content h1 {
    max-width: 760px;
    margin: 20px 0 16px;
    font-size: clamp(42px, 8vw, 86px);
    line-height: 0.95;
    letter-spacing: -0.07em;
}

.hero-content p {
    max-width: 720px;
    margin: 0;
    color: #cbd5e1;
    font-size: clamp(17px, 2vw, 22px);
}

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

.hero-tags span,
.detail-chips span,
.tag-cloud span,
.tag-row span {
    border: 1px solid rgba(45, 212, 191, 0.26);
    color: #99f6e4;
    background: rgba(20, 184, 166, 0.11);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
}

.hero-actions,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.small-actions {
    margin-top: 22px;
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #fff;
    background: rgba(2, 6, 23, 0.5);
    cursor: pointer;
    font-size: 40px;
    transform: translateY(-50%);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.hero-arrow:hover {
    border-color: rgba(45, 212, 191, 0.7);
    background: rgba(15, 23, 42, 0.85);
}

.hero-prev {
    left: 30px;
}

.hero-next {
    right: 30px;
}

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

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

.hero-dot.is-active {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.hero-search {
    position: absolute;
    left: 50%;
    bottom: 28px;
    z-index: 5;
    width: min(760px, calc(100% - 32px));
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(18px);
}

.hero-search button {
    padding: 13px 22px;
}

.section-wrap,
.filter-panel {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

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

.intro-band,
.filter-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 34px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.86), rgba(17, 94, 89, 0.2));
    box-shadow: var(--shadow);
}

.intro-band h2,
.section-heading h2,
.ranking-panel h2,
.filter-panel h2,
.detail-content h2,
.meta-card h2 {
    margin: 0;
    letter-spacing: -0.04em;
}

.intro-band h2 {
    max-width: 800px;
    font-size: clamp(28px, 4vw, 52px);
    line-height: 1.05;
}

.intro-band p,
.filter-panel p,
.page-hero p,
.category-card p,
.category-tile small,
.site-footer p {
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 12px;
}

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

.section-heading h2,
.ranking-panel h2,
.filter-panel h2 {
    font-size: clamp(26px, 3vw, 42px);
}

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

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

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.76);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
    border-color: rgba(45, 212, 191, 0.46);
    box-shadow: 0 24px 70px rgba(20, 184, 166, 0.12);
    transform: translateY(-4px);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #0f172a;
}

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

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

.poster-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.9), transparent 52%);
}

.poster-play {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    color: #042f2e;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.rank-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    color: #fff7ed;
    background: rgba(249, 115, 22, 0.92);
    font-weight: 900;
}

.card-body {
    padding: 16px;
}

.card-body h3 {
    margin: 0 0 10px;
    font-size: 17px;
    line-height: 1.3;
}

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

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
}

.card-meta span + span::before {
    content: "·";
    margin-right: 8px;
    color: #475569;
}

.card-body p {
    display: -webkit-box;
    min-height: 44px;
    margin: 0 0 12px;
    overflow: hidden;
    color: #cbd5e1;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 14px;
}

.tag-row span {
    padding: 4px 8px;
    font-size: 11px;
}

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

.category-panel,
.ranking-panel,
.meta-card {
    border: 1px solid var(--border);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: var(--shadow);
}

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

.category-grid,
.category-card-grid {
    display: grid;
    gap: 14px;
}

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

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

.category-tile,
.category-card {
    display: block;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(2, 6, 23, 0.32);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.category-tile {
    padding: 18px;
}

.category-card {
    min-height: 210px;
    padding: 24px;
}

.category-tile:hover,
.category-card:hover {
    border-color: rgba(45, 212, 191, 0.52);
    background: rgba(20, 184, 166, 0.08);
    transform: translateY(-3px);
}

.category-tile span,
.category-card h2 {
    display: block;
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 900;
}

.category-icon {
    display: inline-grid;
    width: 54px;
    height: 54px;
    margin-bottom: 22px;
    place-items: center;
    border-radius: 18px;
    color: #042f2e;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    font-weight: 900;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.34);
}

.rank-row:hover {
    border-color: rgba(45, 212, 191, 0.5);
}

.rank-number {
    grid-row: span 2;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 14px;
    color: var(--accent);
    background: rgba(45, 212, 191, 0.1);
    font-weight: 900;
}

.rank-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 900;
}

.rank-info {
    color: var(--muted);
    font-size: 12px;
}

.page-main,
.detail-main {
    padding-top: 34px;
}

.page-hero,
.detail-hero {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: 34px;
    background:
        radial-gradient(circle at 85% 15%, rgba(45, 212, 191, 0.18), transparent 22rem),
        linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(2, 6, 23, 0.68));
    box-shadow: var(--shadow);
}

.page-hero {
    padding: 58px;
}

.page-hero h1 {
    max-width: 820px;
    margin: 0 0 16px;
    font-size: clamp(36px, 6vw, 66px);
    line-height: 1;
    letter-spacing: -0.06em;
}

.page-hero p {
    max-width: 760px;
    margin: 0;
    font-size: 18px;
}

.filter-panel {
    margin-top: 28px;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    min-width: min(540px, 100%);
}

.filter-controls input {
    flex: 1;
    padding: 14px 18px;
}

.filter-controls select {
    padding: 14px 18px;
}

.empty-state {
    display: none;
    margin-top: 24px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--muted);
    text-align: center;
    background: rgba(15, 23, 42, 0.72);
}

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

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    color: #cbd5e1;
    font-size: 14px;
}

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

.detail-hero {
    padding: 24px;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.8fr);
    gap: 28px;
    align-items: stretch;
}

.player-shell {
    position: relative;
    overflow: hidden;
    min-height: 420px;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 28px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.player-shell video {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #020617;
}

.play-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    gap: 12px;
    border: 0;
    color: #ffffff;
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.16), rgba(2, 6, 23, 0.8)),
        rgba(2, 6, 23, 0.12);
    cursor: pointer;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.big-play {
    display: grid;
    width: 88px;
    height: 88px;
    place-items: center;
    border-radius: 50%;
    color: #042f2e;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 50px rgba(45, 212, 191, 0.45);
    font-size: 34px;
}

.detail-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
}

.detail-info h1 {
    margin: 0 0 18px;
    font-size: clamp(34px, 4vw, 58px);
    line-height: 1;
    letter-spacing: -0.06em;
}

.detail-one-line {
    color: #cbd5e1;
    font-size: 18px;
}

.detail-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
}

.detail-content article,
.meta-card {
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.72);
}

.detail-content article p {
    color: #cbd5e1;
    font-size: 17px;
    line-height: 1.85;
}

.detail-content article h2 + p {
    margin-top: 12px;
}

.meta-card dl {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 12px;
    margin: 22px 0;
}

.meta-card dt {
    color: var(--muted);
}

.meta-card dd {
    margin: 0;
}

.sticky-rank {
    position: sticky;
    top: 100px;
}

.site-footer {
    margin-top: 64px;
    border-top: 1px solid var(--border);
    background: rgba(2, 6, 23, 0.72);
}

.footer-inner {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-inner p {
    max-width: 620px;
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: #cbd5e1;
}

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

@media (max-width: 1180px) {
    .movie-grid,
    .library-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

    .sticky-rank {
        position: static;
    }
}

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

    .menu-button {
        display: inline-flex;
        margin-left: auto;
    }

    .header-inner {
        height: 68px;
    }

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

    .hero-content {
        padding: 130px 0 170px;
    }

    .hero-arrow {
        display: none;
    }

    .intro-band,
    .filter-panel,
    .footer-inner {
        align-items: stretch;
        flex-direction: column;
    }

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

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

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

    .player-shell {
        min-height: 320px;
    }
}

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

    .hero-content h1 {
        font-size: 46px;
    }

    .hero-search {
        border-radius: 28px;
        flex-direction: column;
    }

    .hero-search button,
    .hero-search input {
        width: 100%;
    }

    .section-wrap {
        padding: 46px 0;
    }

    .page-hero,
    .detail-hero {
        border-radius: 26px;
        padding: 26px;
    }

    .movie-grid,
    .compact-grid,
    .library-grid,
    .ranking-grid,
    .category-card-grid,
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .card-body {
        padding: 13px;
    }

    .card-body p,
    .tag-row {
        display: none;
    }

    .filter-controls {
        min-width: 0;
    }

    .filter-controls input,
    .filter-controls select {
        width: 100%;
    }
}

@media (max-width: 440px) {
    .movie-grid,
    .compact-grid,
    .library-grid,
    .ranking-grid,
    .category-card-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }
}
