:root {
    --bg: #f6faf8;
    --surface: #ffffff;
    --surface-soft: #eff7f3;
    --text: #14211b;
    --muted: #647067;
    --line: #dcebe3;
    --primary: #059669;
    --primary-dark: #047857;
    --accent: #14b8a6;
    --gold: #f59e0b;
    --shadow: 0 18px 45px rgba(15, 48, 36, 0.12);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: radial-gradient(circle at top left, rgba(20, 184, 166, 0.12), transparent 32rem), var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(220, 235, 227, 0.9);
    backdrop-filter: blur(18px);
}

.header-inner {
    max-width: 1240px;
    margin: 0 auto;
    min-height: 76px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 26px;
}

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

.logo-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #ffffff;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 12px 28px rgba(5, 150, 105, 0.32);
}

.logo-text {
    font-size: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

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

.main-nav a,
.mobile-panel a {
    color: #3c4b43;
    font-weight: 650;
    padding: 10px 14px;
    border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active,
.mobile-panel a:hover,
.mobile-panel a.active {
    color: var(--primary-dark);
    background: rgba(5, 150, 105, 0.1);
}

.header-search,
.mobile-search {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 48, 36, 0.08);
}

.header-search input,
.mobile-search input {
    width: 240px;
    border: 0;
    outline: 0;
    padding: 11px 14px 11px 18px;
    background: transparent;
    color: var(--text);
}

.header-search button,
.mobile-search button,
.primary-button,
.secondary-button,
.filter-bar button,
.hero-control,
.player-start {
    border: 0;
    cursor: pointer;
}

.header-search button,
.mobile-search button {
    color: #ffffff;
    padding: 11px 18px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: var(--surface-soft);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    width: 19px;
    height: 2px;
    background: var(--text);
    border-radius: 999px;
}

.mobile-panel {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px 18px;
}

.mobile-panel nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.mobile-panel a {
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
}

.page-main {
    max-width: 1240px;
    margin: 0 auto;
    padding: 34px 24px 72px;
}

.hero-slider {
    position: relative;
    max-width: 1240px;
    margin: 26px auto 46px;
    padding: 0 24px;
}

.hero-window {
    position: relative;
    overflow: hidden;
    min-height: 560px;
    border-radius: 34px;
    background: #0f221a;
    box-shadow: var(--shadow);
}

.hero-slide {
    display: none;
    min-height: 560px;
    background-image: linear-gradient(90deg, rgba(5, 12, 9, 0.92) 0%, rgba(5, 20, 14, 0.72) 45%, rgba(5, 20, 14, 0.24) 100%), var(--hero-image);
    background-size: cover;
    background-position: center;
    color: #ffffff;
}

.hero-slide.is-active {
    display: block;
    animation: fadeIn 0.55s ease both;
}

.hero-content {
    max-width: 640px;
    padding: 86px 72px;
}

.hero-eyebrow,
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #a7f3d0;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-content h1 {
    margin: 14px 0 8px;
    font-size: clamp(34px, 6vw, 68px);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.hero-content h2 {
    margin: 0 0 18px;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.12;
}

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

.hero-meta,
.detail-meta,
.movie-meta-line,
.tag-row,
.hero-actions,
.detail-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

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

.hero-meta span,
.detail-meta span,
.movie-meta-line span {
    color: #2d6b53;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(5, 150, 105, 0.1);
}

.hero-meta span {
    color: #d1fae5;
    background: rgba(255, 255, 255, 0.14);
}

.primary-button,
.secondary-button {
    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-button {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 16px 35px rgba(5, 150, 105, 0.32);
}

.secondary-button {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.36);
    background: rgba(255, 255, 255, 0.14);
}

.primary-button:hover,
.secondary-button:hover,
.movie-card:hover,
.category-card:hover,
.ranking-link:hover {
    transform: translateY(-3px);
}

.hero-controls {
    position: absolute;
    right: 52px;
    bottom: 34px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-control {
    width: 44px;
    height: 44px;
    color: #ffffff;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 22px;
    margin: 48px 0 22px;
}

.section-heading span {
    color: var(--primary);
    font-weight: 850;
    letter-spacing: 0.08em;
}

.section-heading h2,
.page-hero h1,
.detail-title h1 {
    margin: 6px 0;
    font-size: clamp(28px, 3.2vw, 44px);
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.section-heading p,
.page-hero p,
.detail-title p,
.category-card p,
.search-panel p {
    margin: 0;
    color: var(--muted);
}

.section-heading a {
    color: var(--primary-dark);
    font-weight: 800;
    white-space: nowrap;
}

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

.movie-card,
.category-card,
.info-panel,
.search-panel,
.ranking-panel,
.detail-panel {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(220, 235, 227, 0.9);
    border-radius: var(--radius);
    box-shadow: 0 12px 34px rgba(15, 48, 36, 0.08);
}

.movie-card {
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
    box-shadow: var(--shadow);
}

.poster-link {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.18), rgba(20, 184, 166, 0.08));
}

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

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

.card-play {
    position: absolute;
    right: 12px;
    bottom: 12px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(5, 150, 105, 0.92);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.rank-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #ffffff;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), #ef4444);
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.25);
}

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

.movie-meta-line {
    gap: 6px;
}

.movie-meta-line span {
    padding: 3px 8px;
    font-size: 12px;
}

.movie-card h3 {
    margin: 10px 0 8px;
    font-size: 17px;
    line-height: 1.28;
}

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

.movie-card p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
}

.tag-row span {
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--surface-soft);
}

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

.category-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card::after {
    content: "";
    position: absolute;
    right: -38px;
    bottom: -44px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.16), rgba(20, 184, 166, 0.08));
}

.category-card strong {
    display: block;
    margin-bottom: 10px;
    font-size: 21px;
}

.category-card span {
    display: inline-flex;
    margin-top: 18px;
    color: var(--primary-dark);
    font-weight: 800;
}

.page-hero,
.detail-hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
    align-items: center;
    padding: 32px;
    margin-bottom: 34px;
    border-radius: 34px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 247, 243, 0.96));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.page-hero-visual,
.detail-poster {
    overflow: hidden;
    border-radius: 28px;
    box-shadow: 0 18px 40px rgba(15, 48, 36, 0.16);
}

.page-hero-visual img,
.detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-hero-visual {
    aspect-ratio: 16 / 9;
}

.detail-poster {
    max-width: 380px;
    margin-left: auto;
    aspect-ratio: 2 / 3;
}

.filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: 24px;
}

.filter-bar input {
    flex: 1 1 260px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 16px;
    outline: 0;
    background: #ffffff;
}

.filter-bar button {
    min-height: 42px;
    padding: 0 15px;
    color: #2d6b53;
    border-radius: 999px;
    background: var(--surface-soft);
}

.filter-bar button.active,
.filter-bar button:hover {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

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

.ranking-panel {
    padding: 24px;
}

.ranking-panel h2 {
    margin: 0 0 18px;
}

.ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.ranking-link {
    display: grid;
    grid-template-columns: 46px 64px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 10px;
    border-radius: 18px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ranking-link:hover {
    background: var(--surface-soft);
}

.ranking-number {
    color: var(--primary);
    font-size: 22px;
    font-weight: 900;
    text-align: center;
}

.ranking-link img {
    width: 64px;
    height: 86px;
    border-radius: 12px;
    object-fit: cover;
}

.ranking-info strong,
.ranking-info em {
    display: block;
}

.ranking-info strong {
    line-height: 1.35;
}

.ranking-info em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
    margin-top: 4px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
    gap: 28px;
    align-items: start;
}

.player-area,
.detail-panel {
    overflow: hidden;
    border-radius: 28px;
    background: #07120e;
    box-shadow: var(--shadow);
}

.player-shell {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #020806;
}

.player-video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000000;
}

.player-start {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    padding: 15px 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.player-shell.is-playing .player-start {
    opacity: 0;
    pointer-events: none;
}

.play-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.detail-panel {
    color: #d1fae5;
    padding: 24px;
}

.detail-panel h2 {
    margin: 0 0 12px;
    color: #ffffff;
}

.detail-panel p {
    margin: 0 0 18px;
}

.detail-body {
    display: grid;
    gap: 22px;
}

.info-panel {
    padding: 24px;
}

.info-panel h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.info-panel p {
    margin: 0;
    color: #43524a;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    margin-bottom: 18px;
    font-size: 14px;
}

.breadcrumb a {
    color: var(--primary-dark);
    font-weight: 700;
}

.detail-actions {
    margin-top: 24px;
}

.search-panel {
    padding: 28px;
    margin-bottom: 28px;
}

.search-page-form {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.search-page-form input {
    flex: 1;
    min-height: 50px;
    border: 1px solid var(--line);
    border-radius: 999px;
    outline: 0;
    padding: 0 18px;
}

.search-page-form button {
    min-width: 110px;
    color: #ffffff;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    cursor: pointer;
}

.empty-state {
    padding: 32px;
    color: var(--muted);
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.78);
}

.site-footer {
    padding: 42px 24px;
    color: #d1fae5;
    background: #07120e;
}

.footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-logo {
    color: #ffffff;
    font-size: 20px;
}

.footer-inner p {
    margin: 0;
    color: rgba(209, 250, 229, 0.72);
}

.footer-links {
    display: flex;
    gap: 16px;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(1.01);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

    .header-search input {
        width: 190px;
    }
}

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

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

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

    .category-grid,
    .ranking-layout,
    .page-hero,
    .detail-hero,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-poster {
        margin: 0;
        max-width: 320px;
    }

    .hero-content {
        padding: 70px 42px;
    }
}

@media (max-width: 760px) {
    .header-inner,
    .page-main,
    .hero-slider {
        padding-left: 16px;
        padding-right: 16px;
    }

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

    .hero-window,
    .hero-slide {
        min-height: 520px;
    }

    .hero-content {
        padding: 58px 28px 88px;
    }

    .hero-controls {
        right: 30px;
        bottom: 24px;
    }

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

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

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

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

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

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

    .page-hero,
    .detail-hero,
    .search-panel,
    .info-panel,
    .ranking-panel {
        padding: 20px;
        border-radius: 24px;
    }

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

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

@media (max-width: 520px) {
    .mobile-panel nav {
        grid-template-columns: repeat(2, 1fr);
    }

    .mobile-search {
        align-items: stretch;
        flex-direction: column;
        border-radius: 22px;
    }

    .mobile-search input {
        width: 100%;
    }

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

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

    .ranking-link {
        grid-template-columns: 38px 56px minmax(0, 1fr);
    }

    .ranking-link img {
        width: 56px;
        height: 76px;
    }
}

.page-hero .secondary-button,
.detail-hero .secondary-button,
.filter-bar .secondary-button {
    color: var(--primary-dark);
    border-color: rgba(5, 150, 105, 0.16);
    background: rgba(5, 150, 105, 0.1);
}

.page-hero .secondary-button:hover,
.detail-hero .secondary-button:hover,
.filter-bar .secondary-button:hover {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}
