:root {
    --bluestone-50: #f8fafc;
    --bluestone-100: #f1f5f9;
    --bluestone-200: #e2e8f0;
    --bluestone-500: #64748b;
    --bluestone-700: #334155;
    --bluestone-800: #1e293b;
    --bluestone-900: #0f172a;
    --accent-50: #fef3c7;
    --accent-100: #fde68a;
    --accent-400: #f59e0b;
    --accent-500: #d97706;
    --accent-600: #b45309;
    --stone-50: #fafaf9;
    --stone-100: #f5f5f4;
    --stone-200: #e7e5e4;
    --stone-300: #d6d3d1;
    --stone-500: #78716c;
    --stone-600: #57534e;
    --stone-700: #44403c;
    --shadow-card: 0 18px 45px rgba(15, 23, 42, 0.12);
    --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(18px);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

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

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, var(--accent-400), var(--accent-600));
    box-shadow: 0 10px 28px rgba(217, 119, 6, 0.38);
}

.brand-text {
    font-size: 18px;
}

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

.nav-link,
.mobile-link {
    padding: 9px 14px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.78);
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
    color: white;
    background: rgba(255, 255, 255, 0.12);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    padding: 10px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    height: 2px;
    background: white;
    margin: 5px 0;
    border-radius: 999px;
}

.mobile-nav {
    display: none;
    padding: 0 24px 18px;
    gap: 10px;
    flex-wrap: wrap;
}

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

.hero-carousel {
    position: relative;
    min-height: 540px;
    height: 72vh;
    background: var(--bluestone-900);
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 1s ease;
}

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

.hero-slide img,
.detail-hero > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-shade,
.detail-hero-shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 82% 20%, rgba(245, 158, 11, 0.22), transparent 34%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.84), rgba(0, 0, 0, 0.54) 48%, rgba(0, 0, 0, 0.12));
}

.hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    color: white;
}

.hero-content > * {
    max-width: 680px;
}

.hero-kicker,
.section-heading span,
.page-hero span,
.feature-panel span {
    color: var(--accent-400);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-content h1 {
    margin: 12px 0 18px;
    font-size: clamp(38px, 6vw, 76px);
    line-height: 1.04;
    letter-spacing: -0.05em;
}

.hero-content p,
.detail-hero-content p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.82);
    margin: 0 0 22px;
}

.hero-meta,
.card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
}

.hero-meta span:first-child,
.card-meta span:first-child {
    position: relative;
    padding-left: 14px;
}

.hero-meta span:first-child::before,
.card-meta span:first-child::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: var(--accent-400);
}

.hero-tags,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.hero-tags span,
.tag-row span,
.tag-cloud a {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    backdrop-filter: blur(12px);
}

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

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

.primary-btn {
    color: white;
    background: var(--accent-500);
    box-shadow: 0 14px 28px rgba(217, 119, 6, 0.28);
}

.primary-btn:hover {
    transform: translateY(-2px);
    background: var(--accent-600);
    box-shadow: 0 20px 38px rgba(217, 119, 6, 0.34);
}

.ghost-btn {
    color: white;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.ghost-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 46px;
    height: 46px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 999px;
    color: white;
    font-size: 38px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    cursor: pointer;
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
    width: 32px;
    background: var(--accent-400);
}

.section-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 58px 24px;
}

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

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

.section-heading.simple {
    display: block;
}

.section-heading h2,
.page-hero h1,
.detail-hero-content h1 {
    margin: 6px 0 0;
    color: var(--bluestone-900);
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.12;
    letter-spacing: -0.04em;
}

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

.search-panel {
    margin-top: -58px;
    position: relative;
    z-index: 8;
}

.search-panel::before {
    content: "";
    position: absolute;
    inset: 28px 24px 24px;
    z-index: -1;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}

.search-box {
    display: flex;
    gap: 12px;
    max-width: 760px;
    margin: 24px auto 0;
}

.search-box input,
.filter-bar input,
.filter-bar select {
    width: 100%;
    border: 1px solid var(--stone-200);
    border-radius: 999px;
    padding: 13px 18px;
    color: var(--bluestone-900);
    background: white;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--accent-500);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.search-box button {
    border: 0;
    border-radius: 999px;
    padding: 0 22px;
    white-space: nowrap;
    color: white;
    background: var(--bluestone-900);
    cursor: pointer;
}

.search-state,
.filter-state {
    margin-top: 16px;
    text-align: center;
    color: var(--stone-500);
}

.search-results {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

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

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

.category-tile {
    display: block;
    min-height: 210px;
    padding: 24px;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, white, var(--bluestone-50));
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(226, 232, 240, 0.86);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.category-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    margin-bottom: 16px;
    color: white;
    font-weight: 900;
    background: linear-gradient(135deg, var(--bluestone-800), var(--accent-500));
}

.category-tile strong {
    display: block;
    font-size: 20px;
    color: var(--bluestone-900);
    margin-bottom: 8px;
}

.category-tile p {
    margin: 0 0 16px;
    color: var(--stone-600);
}

.category-tile div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tile div a {
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 999px;
    color: var(--accent-600);
    background: var(--accent-50);
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

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

.catalog-grid {
    align-items: start;
}

.movie-scroll {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(200px, 1fr);
    gap: 18px;
    overflow-x: auto;
    padding: 6px 2px 16px;
    scroll-snap-type: x proximity;
}

.movie-scroll .movie-card {
    scroll-snap-align: start;
}

.movie-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(226, 232, 240, 0.9);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--bluestone-900);
}

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

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

.poster-glow {
    position: absolute;
    inset: auto 0 0;
    height: 45%;
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.72), transparent);
}

.rank-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-400), var(--accent-600));
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.card-body {
    padding: 16px;
}

.card-meta {
    color: var(--stone-500);
    gap: 8px 12px;
}

.card-body h3 {
    margin: 10px 0 8px;
    color: var(--bluestone-900);
    font-size: 17px;
    line-height: 1.35;
}

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

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

.tag-row span {
    color: var(--stone-700);
    background: var(--stone-100);
    backdrop-filter: none;
}

.compact-card .card-body p {
    min-height: 44px;
}

.two-col-section {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 28px;
    align-items: start;
}

.feature-panel {
    position: sticky;
    top: 92px;
    min-height: 420px;
    border-radius: var(--radius-xl);
    padding: 36px;
    color: white;
    background:
        radial-gradient(circle at 82% 20%, rgba(245, 158, 11, 0.34), transparent 34%),
        linear-gradient(135deg, var(--bluestone-900), var(--bluestone-700));
    box-shadow: var(--shadow-card);
}

.feature-panel h2 {
    margin: 14px 0 16px;
    font-size: 40px;
    line-height: 1.1;
}

.feature-panel p {
    color: rgba(255, 255, 255, 0.76);
    margin-bottom: 28px;
}

.ranking-list {
    display: grid;
    gap: 16px;
}

.compact-ranking {
    max-height: 810px;
    overflow: auto;
    padding-right: 8px;
}

.ranking-item {
    display: grid;
    grid-template-columns: 116px 1fr;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border-radius: var(--radius-lg);
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: var(--shadow-soft);
}

.ranking-cover {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--bluestone-900);
}

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

.ranking-cover span {
    position: absolute;
    left: 8px;
    top: 8px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: white;
    font-weight: 900;
    background: var(--accent-500);
}

.ranking-content h3 {
    margin: 8px 0;
    color: var(--bluestone-900);
    font-size: 22px;
    line-height: 1.25;
}

.ranking-content p {
    margin: 0;
    color: var(--stone-600);
}

.page-hero {
    min-height: 320px;
    display: grid;
    place-items: center;
    padding: 80px 24px;
    color: white;
    text-align: center;
    background:
        radial-gradient(circle at 20% 30%, rgba(245, 158, 11, 0.28), transparent 28%),
        radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0.12), transparent 28%),
        linear-gradient(135deg, var(--bluestone-900), var(--bluestone-700));
}

.page-hero > div {
    max-width: 860px;
}

.page-hero h1 {
    color: white;
}

.page-hero p {
    color: rgba(255, 255, 255, 0.78);
    margin: 18px auto 0;
    font-size: 18px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
}

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

.category-hero,
.ranking-hero {
    text-align: left;
    place-items: end start;
}

.category-hero > div,
.ranking-hero > div {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

.filter-panel {
    padding-top: 36px;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px 180px 180px;
    gap: 14px;
    margin-bottom: 24px;
    padding: 18px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.detail-hero {
    position: relative;
    min-height: 520px;
    overflow: hidden;
    background: var(--bluestone-900);
}

.detail-hero-content {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    margin: 0 auto;
    min-height: 520px;
    padding: 110px 24px 70px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: end;
}

.detail-hero-content > * {
    max-width: 780px;
}

.detail-hero-content h1 {
    color: white;
    margin-top: 18px;
}

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

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

.detail-main,
.detail-side {
    display: grid;
    gap: 22px;
    align-content: start;
}

.player-card,
.content-card,
.side-card {
    border-radius: var(--radius-xl);
    background: white;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(226, 232, 240, 0.9);
    overflow: hidden;
}

.video-shell {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bluestone-900);
}

.video-shell video {
    width: 100%;
    height: 100%;
    display: block;
    background: black;
    object-fit: contain;
}

.play-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    color: white;
    background: rgba(15, 23, 42, 0.38);
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-icon {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-500);
    box-shadow: 0 18px 42px rgba(217, 119, 6, 0.38);
    font-size: 30px;
    padding-left: 5px;
}

.player-status {
    min-height: 40px;
    padding: 10px 18px;
    color: var(--stone-500);
    font-size: 14px;
}

.content-card {
    padding: 28px;
}

.content-card h2,
.side-card h2 {
    margin: 0 0 16px;
    color: var(--bluestone-900);
    font-size: 24px;
}

.content-card p {
    margin: 0;
    color: var(--stone-700);
    font-size: 16px;
}

.side-card {
    padding: 22px;
}

.poster-card {
    padding: 0;
}

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

.full-btn {
    width: calc(100% - 32px);
    margin: 16px;
}

.info-list {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px 14px;
    margin: 0;
}

.info-list dt {
    color: var(--stone-500);
}

.info-list dd {
    margin: 0;
    color: var(--bluestone-900);
    font-weight: 700;
}

.tag-cloud div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud a {
    color: var(--stone-700);
    background: var(--stone-100);
}

.tag-cloud a:hover {
    color: white;
    background: var(--accent-500);
}

.site-footer {
    margin-top: 48px;
    background: var(--bluestone-900);
    color: rgba(255, 255, 255, 0.76);
}

.footer-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 46px 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
    gap: 36px;
}

.footer-logo {
    color: white;
    font-size: 20px;
    margin-bottom: 14px;
}

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

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-content: start;
    justify-content: flex-end;
}

.footer-links a {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.footer-links a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.is-filtered-out {
    display: none !important;
}

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

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

    .detail-layout,
    .two-col-section {
        grid-template-columns: 1fr;
    }

    .feature-panel {
        position: static;
    }
}

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

    .menu-toggle {
        display: block;
    }

    .hero-carousel {
        min-height: 620px;
        height: auto;
    }

    .hero-content {
        padding-top: 90px;
        padding-bottom: 90px;
    }

    .hero-arrow {
        display: none;
    }

    .search-box,
    .filter-bar {
        grid-template-columns: 1fr;
        display: grid;
    }

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

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

    .ranking-item {
        grid-template-columns: 92px 1fr;
    }

    .footer-wrap {
        grid-template-columns: 1fr;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .nav-wrap,
    .section-wrap,
    .detail-hero-content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .hero-content h1,
    .detail-hero-content h1 {
        font-size: 38px;
    }

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

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

    .movie-scroll {
        grid-auto-columns: minmax(180px, 78vw);
    }

    .ranking-item {
        grid-template-columns: 1fr;
    }

    .ranking-cover {
        max-width: 180px;
    }
}
