:root {
    --page-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-soft: #6b7280;
    --line: #e5e7eb;
    --orange: #ea580c;
    --amber: #f59e0b;
    --dark: #0f172a;
    --radius: 1.25rem;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: linear-gradient(180deg, #ffffff 0%, var(--page-bg) 100%);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

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

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
    backdrop-filter: blur(16px);
}

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

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

.brand-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #ffffff;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--orange), var(--amber));
    box-shadow: 0 12px 24px rgba(234, 88, 12, 0.28);
}

.brand-text strong,
.footer-brand {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(90deg, var(--orange), var(--amber));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-text small {
    display: block;
    color: var(--text-soft);
    font-size: 0.78rem;
    margin-top: 2px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    color: #374151;
    font-weight: 600;
}

.main-nav a {
    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: var(--orange);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: #fff7ed;
    color: var(--orange);
    font-size: 1.35rem;
}

.hero {
    position: relative;
    min-height: 70vh;
    overflow: hidden;
    background: var(--dark);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    background-position: center;
    background-size: cover;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.7s ease, transform 4s ease;
}

.hero-slide.is-active {
    opacity: 1;
    transform: scale(1);
    z-index: 1;
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.84), rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.06));
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    color: #ffffff;
}

.hero-content h1 {
    width: min(720px, 100%);
    margin: 16px 0;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
    font-weight: 900;
}

.hero-content p {
    width: min(660px, 100%);
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.8;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(234, 88, 12, 0.92);
    font-weight: 800;
    box-shadow: 0 12px 32px rgba(234, 88, 12, 0.28);
}

.hero-tags,
.card-tags,
.chip-row,
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

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

.hero-tag,
.chip,
.card-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
}

.hero-tag {
    padding: 8px 13px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(10px);
}

.chip,
.card-tag {
    padding: 6px 10px;
    color: #9a3412;
    background: #ffedd5;
}

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

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

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--orange), var(--amber));
    box-shadow: 0 14px 28px rgba(234, 88, 12, 0.28);
}

.btn-ghost {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
}

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

.hero-dot {
    width: 28px;
    height: 8px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
    width: 48px;
    background: #ffffff;
}

.quick-search,
.content-section,
.category-preview,
.breadcrumb,
.detail-layout {
    width: min(1280px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
}

.quick-search {
    margin-top: -36px;
    position: relative;
    z-index: 8;
}

.search-panel {
    display: grid;
    gap: 10px;
    padding: 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: var(--shadow);
}

.search-panel label {
    color: #9a3412;
    font-weight: 800;
}

.search-panel input {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    outline: none;
    background: #f9fafb;
    color: var(--text-main);
}

.search-panel input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.12);
}

.content-section,
.category-preview {
    padding: 56px 0 0;
}

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

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    font-weight: 900;
    letter-spacing: -0.03em;
}

.section-heading p {
    margin: 8px 0 0;
    color: var(--text-soft);
}

.section-link {
    color: var(--orange);
    font-weight: 800;
}

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

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

.movie-card {
    overflow: hidden;
    border-radius: 22px;
    background: var(--card-bg);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(229, 231, 235, 0.78);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

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

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

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

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

.poster-badge,
.poster-play {
    position: absolute;
    z-index: 2;
    border-radius: 999px;
    color: #ffffff;
    font-weight: 800;
}

.poster-badge {
    left: 10px;
    top: 10px;
    padding: 6px 10px;
    background: rgba(234, 88, 12, 0.9);
}

.poster-play {
    left: 50%;
    bottom: 14px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.58);
    transform: translateX(-50%);
    backdrop-filter: blur(8px);
}

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

.card-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.movie-card h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    line-height: 1.35;
    font-weight: 900;
}

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

.movie-card p {
    min-height: 3.2em;
    margin: 0 0 14px;
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.category-tile {
    position: relative;
    min-height: 220px;
    overflow: hidden;
    border-radius: 24px;
    background: #111827;
    box-shadow: var(--shadow);
}

.category-tile img {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.category-tile:hover img {
    transform: scale(1.08);
}

.category-tile-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.78));
}

.category-tile-content {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    color: #ffffff;
}

.category-tile-content strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.25rem;
    font-weight: 900;
}

.category-tile-content small {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.6;
}

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

.ranking-panel,
.side-card,
.detail-card {
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid rgba(229, 231, 235, 0.86);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.ranking-panel {
    position: sticky;
    top: 92px;
    padding: 22px;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 42px 58px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
    background: #f9fafb;
    transition: background 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
    background: #fff7ed;
    transform: translateX(4px);
}

.rank-no {
    color: var(--orange);
    font-weight: 900;
    text-align: center;
}

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

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

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

.rank-info small {
    margin-top: 5px;
    color: var(--text-soft);
}

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

.page-hero {
    width: min(1280px, calc(100% - 32px));
    margin: 32px auto 0;
    padding: clamp(36px, 6vw, 72px);
    border-radius: 32px;
    color: #ffffff;
    background: radial-gradient(circle at top left, rgba(251, 191, 36, 0.38), transparent 36%), linear-gradient(135deg, #ea580c, #f59e0b);
    box-shadow: var(--shadow);
}

.page-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: -0.04em;
}

.page-hero p {
    width: min(760px, 100%);
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.8;
}

.inline-search {
    width: min(680px, 100%);
    margin-top: 28px;
    color: var(--text-main);
}

.wide-search {
    width: min(900px, 100%);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 28px 0 18px;
    color: var(--text-soft);
}

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

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

.detail-main {
    display: grid;
    gap: 24px;
}

.watch-player {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: #000000;
    aspect-ratio: 16 / 9;
    box-shadow: var(--shadow);
}

.movie-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000000;
}

.play-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 12px;
    border: 0;
    color: #ffffff;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.20), rgba(0, 0, 0, 0.62));
}

.watch-player.is-playing .play-cover {
    display: none;
}

.play-circle {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--orange), var(--amber));
    box-shadow: 0 18px 42px rgba(234, 88, 12, 0.36);
    font-size: 2.2rem;
}

.detail-card {
    padding: clamp(24px, 4vw, 38px);
}

.detail-card h1 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 900;
    letter-spacing: -0.04em;
}

.detail-lead {
    color: #4b5563;
    font-size: 1.15rem;
    line-height: 1.8;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0;
}

.detail-meta span {
    padding: 8px 12px;
    border-radius: 999px;
    color: #1d4ed8;
    background: #dbeafe;
    font-weight: 700;
}

.detail-card h2,
.side-card h2 {
    margin: 32px 0 12px;
    font-size: 1.4rem;
    font-weight: 900;
}

.detail-card p {
    color: #374151;
    line-height: 1.95;
}

.detail-side {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 18px;
}

.detail-poster {
    width: 100%;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.side-card {
    padding: 22px;
}

.side-card dl {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px 14px;
    margin: 0 0 20px;
}

.side-card dt {
    color: var(--text-soft);
}

.side-card dd {
    margin: 0;
    font-weight: 700;
}

.full-btn {
    width: 100%;
}

.detail-nav-links {
    display: grid;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.detail-nav-links a {
    color: var(--orange);
    font-weight: 800;
}

.site-footer {
    margin-top: 72px;
    background: linear-gradient(180deg, #f9fafb, #eef2f7);
    border-top: 1px solid var(--line);
}

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

.footer-inner p {
    max-width: 680px;
    color: var(--text-soft);
    line-height: 1.8;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px 20px;
}

.footer-links a {
    color: #4b5563;
    font-weight: 700;
}

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

[hidden] {
    display: none !important;
}

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

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

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

    .ranking-panel,
    .detail-side {
        position: static;
    }
}

@media (max-width: 820px) {
    .header-inner {
        height: auto;
        min-height: 68px;
        flex-wrap: wrap;
        padding: 12px 0;
    }

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

    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px 0;
    }

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

    .main-nav a {
        padding: 12px 6px;
        border-top: 1px solid var(--line);
    }

    .hero {
        min-height: 78vh;
    }

    .hero-shade {
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.82));
    }

    .movie-grid,
    .preview-grid,
    .compact-grid,
    .side-grid,
    .large-rank {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .section-heading,
    .footer-inner {
        grid-template-columns: 1fr;
        display: grid;
        align-items: start;
    }

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

@media (max-width: 520px) {
    .movie-grid,
    .preview-grid,
    .compact-grid,
    .side-grid {
        grid-template-columns: 1fr;
    }

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

    .page-hero,
    .detail-card,
    .search-panel {
        border-radius: 20px;
    }

    .hero-actions .btn {
        width: 100%;
    }
}
