/* ========== 全局重置 ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    color: #333;
    background: #f0f0f0;
    line-height: 1.7;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

a:hover {
    color: #e8352a;
}

ul, ol {
    list-style: none;
}

img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ========== 导航栏 ========== */
#header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #111;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

#header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 62px;
    gap: 16px;
}

.logo h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
}

.logo h1 a {
    color: #e8352a;
}

.logo h1 a:hover {
    color: #ff6b5b;
}

/* 主导航 */
#nav ul {
    display: flex;
    align-items: center;
    gap: 2px;
}

#nav ul li a {
    display: block;
    padding: 7px 14px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #ccc;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

#nav ul li a:hover,
#nav ul li a.active {
    background: #e8352a;
    color: #fff;
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    height: 2px;
    background: #ccc;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ========== Banner 轮播 ========== */
.banner {
    background: #000;
    position: relative;
    overflow: hidden;
}

.banner .container {
    position: relative;
    max-width: 100%;
    padding: 0;
}

.slider {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.7s ease;
}

.slide.active {
    opacity: 1;
}

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

.slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(0,0,0,0.7) 0%,
        rgba(0,0,0,0.35) 55%,
        rgba(0,0,0,0.05) 100%
    );
    pointer-events: none;
}

.slide-content {
    position: absolute;
    bottom: 120px;
    left: 80px;
    color: #fff;
    max-width: 540px;
    z-index: 2;
}

.slide-content h2 {
    font-size: 38px;
    font-weight: 800;
    margin-bottom: 14px;
    line-height: 1.3;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

.slide-content p {
    font-size: 16px;
    margin-bottom: 26px;
    opacity: 0.9;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    line-height: 1.6;
}

/* 轮播圆点 */
.slider-dots {
    position: absolute;
    bottom: 80px;
    left: 80px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slider-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.slider-dots .dot.active {
    background: #e8352a;
    transform: scale(1.3);
}

/* Banner 搜索框 */
.banner-search {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    padding: 0 16px;
    z-index: 10;
}

.search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 20px;
    font-size: 15px;
    color: #333;
    background: transparent;
}

.search-box input::placeholder {
    color: #aaa;
}

.search-box button {
    padding: 14px 30px;
    background: #e8352a;
    color: #fff;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.search-box button:hover {
    background: #c42b21;
}

/* ========== 通用按钮 ========== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background: #e8352a;
    color: #fff;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background: #c42b21;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(232,53,42,0.4);
}

/* ========== 通用 Section ========== */
section {
    padding: 52px 0;
}

section:nth-child(even) {
    background: #fff;
}

section:nth-child(odd) {
    background: #f0f0f0;
}

.banner {
    background: #000 !important;
}

.section-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.section-title h2 {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    position: relative;
    padding-left: 14px;
    margin-right: auto;
}

.section-title h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    background: #e8352a;
    border-radius: 2px;
}

.section-title p {
    font-size: 13px;
    color: #888;
    flex-basis: 100%;
    padding-left: 14px;
    margin-top: -6px;
}

.more {
    font-size: 13px;
    color: #e8352a;
    white-space: nowrap;
    padding: 5px 14px;
    border: 1px solid #e8352a;
    border-radius: 20px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.more:hover {
    background: #e8352a;
    color: #fff;
}

/* ========== 电影卡片列表 ========== */
.movie-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.movie-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transition: transform 0.25s, box-shadow 0.25s;
    cursor: pointer;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.14);
}

.movie-card > a {
    display: block;
    color: inherit;
}

.movie-cover {
    position: relative;
    padding-top: 58%;
    overflow: hidden;
    background: #1a1a1a;
}

.movie-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
}

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

.play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: rgba(255,255,255,0);
    background: rgba(0,0,0,0);
    transition: all 0.3s;
    z-index: 2;
}

.movie-card:hover .play-icon {
    color: rgba(255,255,255,0.9);
    background: rgba(0,0,0,0.35);
}

.tag {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #e8352a;
    z-index: 3;
    letter-spacing: 0.3px;
}

.movie-info {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.movie-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-info p {
    font-size: 12px;
    color: #888;
}

.score {
    font-size: 13px;
    font-weight: 700;
    color: #e8352a;
}

/* ========== 热门推荐网格 ========== */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.movie-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    padding-top: 65%;
    background: #1a1a1a;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.25s, box-shadow 0.25s;
}

.movie-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
}

.movie-item > a {
    position: absolute;
    inset: 0;
    display: block;
}

.movie-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
}

.movie-item:hover img {
    transform: scale(1.07);
}

.movie-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px 14px 14px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff;
    z-index: 2;
}

.movie-overlay h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.movie-overlay p {
    font-size: 12px;
    opacity: 0.8;
}

/* ========== 分类电影 ========== */
.category-list {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.category-item {
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: transform 0.25s, box-shadow 0.25s;
    cursor: pointer;
    text-align: center;
}

.category-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.13);
}

.category-item > a {
    display: block;
    color: inherit;
}

.category-item img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    transition: transform 0.35s;
}

.category-item:hover img {
    transform: scale(1.06);
}

.category-item h3 {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    padding: 10px 8px 4px;
}

.category-item p {
    font-size: 12px;
    color: #888;
    padding-bottom: 12px;
}

/* ========== 排行榜 ========== */
.rank {
    background: #fff;
}

.tab-header {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
}

.tab-header .tab {
    padding: 9px 24px;
    border-radius: 6px 6px 0 0;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    user-select: none;
}

.tab-header .tab:hover {
    color: #e8352a;
    background: #fff5f5;
}

.tab-header .tab.active {
    color: #e8352a;
    border-bottom-color: #e8352a;
    background: #fff5f5;
    font-weight: 700;
}

.rank-list {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.rank-list.active {
    display: flex;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fafafa;
    border-radius: 10px;
    padding: 12px 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.rank-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 18px rgba(0,0,0,0.09);
    background: #fff;
}

.rank-item > a {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    color: inherit;
}

.rank-num {
    font-size: 24px;
    font-weight: 900;
    color: #ddd;
    width: 34px;
    text-align: center;
    flex-shrink: 0;
}

.rank-item:nth-child(1) .rank-num { color: #FFD700; }
.rank-item:nth-child(2) .rank-num { color: #C0C0C0; }
.rank-item:nth-child(3) .rank-num { color: #CD7F32; }

.rank-item img {
    width: 80px;
    height: 54px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

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

.rank-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-info p {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

.stars {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #f5a623;
}

.stars .score {
    color: #e8352a;
    font-weight: 700;
    font-size: 14px;
}

/* ========== 文章资讯 ========== */
.articles {
    background: #f0f0f0;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.article-item {
    display: flex;
    gap: 24px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.article-img {
    width: 220px;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #eee;
}

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

.article-item:hover .article-img img {
    transform: scale(1.05);
}

.article-body {
    flex: 1;
    min-width: 0;
}

.article-body h3 {
    font-size: 17px;
    font-weight: 700;
    color: #222;
    margin-bottom: 8px;
    line-height: 1.5;
}

.article-body h3 a {
    color: #222;
    transition: color 0.2s;
}

.article-body h3 a:hover {
    color: #e8352a;
}

.article-meta {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 10px;
}

.article-body p:not(.article-meta) {
    font-size: 13px;
    color: #666;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 页脚 ========== */
#footer {
    background: #111;
    color: #aaa;
    padding-top: 52px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.8fr 2fr 1fr;
    gap: 36px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.footer-logo h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 10px;
}

.footer-logo h3 a {
    color: #e8352a;
}

.footer-logo h3 a:hover {
    color: #ff6b5b;
}

.footer-logo p {
    font-size: 13px;
    color: #666;
    line-height: 1.7;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.link-group h4 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 14px;
}

.link-group ul li {
    margin-bottom: 9px;
}

.link-group ul li a {
    font-size: 13px;
    color: #777;
    transition: color 0.2s;
}

.link-group ul li a:hover {
    color: #e8352a;
}

.footer-contact h4 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 14px;
}

.footer-contact p {
    font-size: 13px;
    color: #777;
    margin-bottom: 9px;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.social-icon {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    background: rgba(255,255,255,0.07);
    color: #aaa;
    font-size: 12px;
    transition: background 0.2s, color 0.2s;
}

.social-icon:hover {
    background: #e8352a;
    color: #fff;
}

/* 友情链接 */
.footer-friend-links {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.footer-friend-links h4 {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    font-weight: 500;
}

.footer-friend-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.footer-friend-links ul li a {
    font-size: 12px;
    color: #666;
    transition: color 0.2s;
}

.footer-friend-links ul li a:hover {
    color: #e8352a;
}

/* 版权 */
.footer-bottom {
    padding: 22px 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 12px;
    color: #555;
    line-height: 2.2;
}

.footer-bottom p a {
    color: #777;
    transition: color 0.2s;
}

.footer-bottom p a:hover {
    color: #e8352a;
}

/* ========== 回到顶部按钮 ========== */
#backToTop {
    position: fixed;
    right: 24px;
    bottom: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e8352a;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 14px rgba(232,53,42,0.45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#backToTop.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ========== 响应式 1100px ========== */
@media (max-width: 1100px) {
    .movie-list,
    .movie-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .slider {
        height: 400px;
    }

    .slide-content {
        left: 48px;
        bottom: 100px;
    }

    .slider-dots {
        left: 48px;
        bottom: 68px;
    }
}

/* ========== 响应式 768px ========== */
@media (max-width: 768px) {
    #nav {
        display: none;
        position: fixed;
        top: 62px;
        left: 0;
        right: 0;
        background: #111;
        box-shadow: 0 8px 24px rgba(0,0,0,0.4);
        z-index: 999;
        padding: 8px 0 16px;
        max-height: calc(100vh - 62px);
        overflow-y: auto;
    }

    #nav.open {
        display: block;
    }

    #nav ul {
        flex-direction: column;
        gap: 0;
    }

    #nav ul li a {
        padding: 13px 24px;
        border-radius: 0;
        font-size: 15px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .hamburger {
        display: flex;
    }

    .slider {
        height: 280px;
    }

    .slide-content {
        left: 24px;
        bottom: 80px;
        max-width: 300px;
    }

    .slide-content h2 {
        font-size: 22px;
    }

    .slide-content p {
        display: none;
    }

    .slider-dots {
        left: 24px;
        bottom: 52px;
    }

    .movie-list,
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .category-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .article-item {
        flex-direction: column;
        gap: 14px;
        padding: 14px;
    }

    .article-img {
        width: 100%;
        height: 180px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-links {
        grid-template-columns: repeat(3, 1fr);
    }

    section {
        padding: 36px 0;
    }
}

/* ========== 响应式 480px ========== */
@media (max-width: 480px) {
    .movie-list,
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .category-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .slide-content h2 {
        font-size: 18px;
    }

    .slider {
        height: 220px;
    }

    .section-title h2 {
        font-size: 18px;
    }

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

    .rank-item img {
        width: 60px;
        height: 42px;
    }

    .rank-num {
        font-size: 18px;
        width: 24px;
    }
}
