* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: #fafaf9;
    color: #292524;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(16px);
}

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

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: #0c4a6e;
}

.brand-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #ffffff;
    font-size: 13px;
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.25);
}

.brand-text {
    font-size: 20px;
    letter-spacing: 0.02em;
}

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

.nav-link,
.mobile-link {
    color: #57534e;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
    color: #0284c7;
}

.nav-search-button,
.mobile-menu-button {
    border: 0;
    background: transparent;
    color: #57534e;
    font-size: 22px;
    line-height: 1;
}

.mobile-menu-button {
    display: none;
}

.search-panel,
.mobile-panel {
    display: none;
}

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

.header-search,
.mobile-search,
.search-page-form {
    display: flex;
    gap: 12px;
    padding: 14px 0 18px;
}

.mobile-panel {
    border-top: 1px solid #e7e5e4;
    background: #ffffff;
}

.mobile-panel-inner {
    display: grid;
    gap: 14px;
    padding-top: 18px;
    padding-bottom: 18px;
}

.input-field {
    width: 100%;
    min-height: 44px;
    border: 1px solid #d6d3d1;
    border-radius: 12px;
    background: #ffffff;
    color: #292524;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

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

.btn-primary {
    border: 0;
    background: #0284c7;
    color: #ffffff;
}

.btn-primary:hover {
    background: #0369a1;
    transform: translateY(-1px);
}

.btn-outline {
    border: 1px solid #bae6fd;
    color: #0369a1;
    background: #f0f9ff;
}

.btn-outline:hover {
    background: #e0f2fe;
}

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

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.26);
    transform: translateY(-1px);
}

.card {
    overflow: hidden;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.hero-carousel {
    position: relative;
    height: 560px;
    overflow: hidden;
    background: #0c0a09;
}

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

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

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

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.54), rgba(0, 0, 0, 0.08));
}

.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
}

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

.hero-kicker {
    display: inline-flex;
    margin-bottom: 14px;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.14);
    color: #38bdf8;
    padding: 7px 13px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.hero-copy h1,
.page-hero h1,
.detail-copy h1 {
    margin: 0;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.hero-copy p,
.page-hero p,
.detail-copy p {
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(16px, 2.1vw, 20px);
}

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

.hero-tags,
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.hero-tags span,
.detail-tags span {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    padding: 7px 12px;
    font-size: 13px;
    backdrop-filter: blur(10px);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.42);
    color: #ffffff;
    font-size: 34px;
    transform: translateY(-50%);
    transition: background 0.2s ease;
}

.hero-arrow:hover {
    background: rgba(0, 0, 0, 0.68);
}

.hero-prev {
    left: 18px;
}

.hero-next {
    right: 18px;
}

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

.hero-dot {
    width: 9px;
    height: 9px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.48);
    transition: width 0.25s ease, background 0.25s ease;
}

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

.content-section {
    padding: 52px 0 0;
}

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

.section-heading h2 {
    margin: 0;
    color: #1c1917;
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: -0.03em;
}

.section-heading p {
    margin: 8px 0 0;
    color: #78716c;
}

.section-link {
    flex: 0 0 auto;
    color: #0284c7;
    font-weight: 800;
}

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

.home-grid {
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
}

.movie-card a {
    display: block;
    height: 100%;
}

.poster-wrap {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #e7e5e4;
}

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

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

.poster-badge,
.poster-type {
    position: absolute;
    z-index: 2;
    border-radius: 999px;
    padding: 5px 9px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.poster-badge {
    top: 10px;
    left: 10px;
    background: rgba(2, 132, 199, 0.92);
}

.poster-type {
    right: 10px;
    bottom: 10px;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(10px);
}

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

.movie-card-body h3 {
    margin: 0;
    color: #1c1917;
    font-size: 16px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.movie-card:hover h3 {
    color: #0284c7;
}

.movie-card-body p {
    display: -webkit-box;
    margin: 8px 0 12px;
    min-height: 42px;
    overflow: hidden;
    color: #78716c;
    font-size: 13px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.movie-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #a8a29e;
    font-size: 12px;
}

.movie-meta span {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
    gap: 28px;
}

.search-box-card {
    align-self: start;
    padding: 26px;
}

.search-box-card h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

.search-box-card p {
    margin: 0 0 18px;
    color: #78716c;
}

.search-box-card form {
    display: grid;
    gap: 12px;
}

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

.rank-row {
    display: grid;
    grid-template-columns: 48px 54px minmax(160px, 1fr) minmax(120px, 0.8fr) minmax(100px, auto);
    align-items: center;
    gap: 14px;
    border-radius: 14px;
    background: #ffffff;
    padding: 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.11);
}

.rank-number {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 900;
}

.rank-row img {
    width: 54px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    background: #e7e5e4;
}

.rank-title {
    color: #1c1917;
    font-weight: 800;
}

.rank-info,
.rank-score {
    color: #78716c;
    font-size: 13px;
}

.category-grid,
.category-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}

.category-card-main,
.category-overview-card a {
    display: block;
}

.category-card-main {
    padding: 24px;
}

.category-card-main span {
    color: #0284c7;
    font-size: 14px;
    font-weight: 800;
}

.category-card-main strong {
    display: block;
    margin-top: 8px;
    color: #1c1917;
    font-size: 34px;
}

.category-card-main p,
.category-overview-body p {
    margin: 8px 0 0;
    color: #78716c;
}

.category-preview {
    display: grid;
    gap: 8px;
    border-top: 1px solid #f5f5f4;
    padding: 16px 24px 22px;
}

.category-preview a {
    color: #57534e;
    font-size: 14px;
}

.category-preview a:hover {
    color: #0284c7;
}

.category-poster-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 150px;
    overflow: hidden;
}

.category-poster-strip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-overview-body {
    padding: 24px;
}

.category-overview-body h2 {
    margin: 0;
    color: #1c1917;
    font-size: 24px;
}

.category-overview-body span {
    display: inline-flex;
    margin-top: 18px;
    color: #0284c7;
    font-weight: 800;
}

.page-hero,
.detail-hero-section {
    background: #0c0a09;
    color: #ffffff;
    padding: 72px 0;
}

.gradient-hero,
.category-hero,
.detail-hero-section {
    background:
        radial-gradient(circle at 16% 20%, rgba(14, 165, 233, 0.34), transparent 28%),
        linear-gradient(135deg, #0c4a6e 0%, #082f49 48%, #0c0a09 100%);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
}

.breadcrumb a:hover {
    color: #ffffff;
}

.filter-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 180px 180px;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
}

.empty-result {
    display: none;
    margin: 30px 0 0;
    color: #78716c;
    text-align: center;
}

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

.detail-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 34px;
    align-items: center;
}

.detail-poster {
    background: rgba(255, 255, 255, 0.08);
}

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

.detail-copy p {
    max-width: 850px;
}

.video-player {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000000;
    color: #ffffff;
}

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

.player-cover {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    gap: 8px;
    border: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.84));
    color: #ffffff;
    text-align: center;
}

.player-cover.is-hidden,
.player-loading,
.player-message,
.player-controls {
    display: none;
}

.play-circle {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    border-radius: 999px;
    background: #0284c7;
    color: #ffffff;
    font-size: 30px;
    box-shadow: 0 18px 38px rgba(2, 132, 199, 0.35);
}

.player-cover strong {
    font-size: 22px;
}

.player-cover small {
    color: rgba(255, 255, 255, 0.78);
}

.player-loading.is-visible,
.player-message.is-visible {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.72);
    padding: 24px;
    text-align: center;
}

.player-controls.is-visible {
    position: absolute;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 6;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 42px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.62), transparent);
    pointer-events: none;
}

.player-controls button {
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    padding: 8px 14px;
    font-weight: 700;
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

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

.content-card {
    padding: 26px;
}

.content-card h2 {
    margin: 0 0 14px;
    color: #1c1917;
    font-size: 24px;
}

.content-card p {
    margin: 0;
    color: #57534e;
    line-height: 1.8;
}

.info-card {
    grid-column: 1 / -1;
}

.info-card dl {
    display: grid;
    gap: 12px;
    margin: 0;
}

.info-card div {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px;
    border-bottom: 1px solid #f5f5f4;
    padding-bottom: 12px;
}

.info-card dt {
    color: #a8a29e;
    font-weight: 700;
}

.info-card dd {
    margin: 0;
    color: #292524;
}

.site-footer {
    margin-top: 72px;
    background: #1c1917;
    color: #d6d3d1;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 36px;
    padding: 48px 0;
}

.footer-brand {
    color: #ffffff;
    font-size: 18px;
}

.site-footer p {
    margin: 16px 0 0;
    color: #a8a29e;
}

.site-footer h2 {
    margin: 0 0 16px;
    color: #ffffff;
    font-size: 16px;
}

.footer-links {
    display: grid;
    gap: 9px;
}

.footer-links a {
    color: #d6d3d1;
}

.footer-links a:hover {
    color: #38bdf8;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 0;
    color: #a8a29e;
    text-align: center;
    font-size: 14px;
}

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

    .mobile-menu-button {
        display: block;
    }

    .hero-carousel {
        height: 520px;
    }

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

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

    .detail-poster {
        width: min(260px, 100%);
    }

    .filter-toolbar {
        grid-template-columns: 1fr;
    }

    .rank-row {
        grid-template-columns: 38px 48px minmax(0, 1fr);
    }

    .rank-info,
    .rank-score {
        display: none;
    }
}

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

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

    .header-search,
    .mobile-search,
    .search-page-form {
        flex-direction: column;
    }

    .hero-carousel {
        height: 500px;
    }

    .hero-arrow {
        display: none;
    }

    .content-section {
        padding-top: 40px;
    }

    .section-heading {
        align-items: start;
        flex-direction: column;
    }

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

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

    .movie-card-body p {
        min-height: 38px;
        font-size: 12px;
    }

    .page-hero,
    .detail-hero-section {
        padding: 50px 0;
    }
}
