/* 全局过渡效果优化 */
* {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 图片优化 */
img {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    max-width: 100%;
    height: auto;
}

/* Showcase和Carousel布局 */
.showcase {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.showcase-container {
    width: 100%;
    max-width: 1200px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Carousel组件样式 */
.carousel {
    position: relative;
    display: flex;
    align-items: center;
}

.carousel-item {
    position: absolute;
    transition: all 0.5s ease;
    will-change: transform, opacity;
}

.image-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-item:hover {
    transform: scale(1.05);
}

/* 新闻区域布局 */
.news-section {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.news-container {
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 40px 20px;
    margin: 0 auto;
}

.news-left, .news-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 40px;
    max-width: 360px;
}

/* 中心logo区域 */
.news-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
}

.news-logo {
    width: 300px;
    height: auto;
}

.news-text {
    font-size: 48px;
    color: #ffd700;
    font-weight: bold;
}

/* 新闻导航按钮 */
.news-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.news-btn {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #ffd700;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.news-btn.active {
    background: #ffd700;
    color: #000;
}

/* 新闻列表样式 */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.news-item {
    width: 100%;
    height: 120px;
    display: flex;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.news-item-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
}

.news-item-content {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    padding-bottom: 35px; /* 为阅读更多按钮预留空间 */
}

.news-item a,
.news-title-link,
.news-item-more {
    text-decoration: none;
}

.news-item-title {
    font-size: 16px;
    color: #fff;
    margin: 0 0 8px 0; /* 减小标题下方间距 */
}

.news-item-excerpt {
    font-size: 14px;
    color: #ccc;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.news-item-more {
    color: #ffd700;
    font-size: 14px;
    position: absolute;
    bottom: 15px;
    right: 15px;
}

.news-title-link:hover .news-item-title {
    color: #ffd700;
}

/* 状态样式 */
.loading, .error, .no-news {
    padding: 20px;
    text-align: center;
    color: #fff;
}

.error {
    color: #ff4444;
}

/* 体育和电竞模块公共样式 */
.sports-section {
    background-color: rgba(0, 0, 0, 0.3);
}

.sports-section,
.esports-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.sports-container,
.esports-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    padding: 0 20px;
}

.sports-left,
.sports-right,
.esports-left,
.esports-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    padding: 20px;
}

.sports-center,
.esports-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.section-logo {
    width: 300px;
    height: auto;
}

.section-text {
    font-size: 48px;
    color: #ffd700;
    font-weight: bold;
}

/* 文字内容样式 */
.sports-right p,
.esports-left p {
    color: #fff;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.sports-right h2,
.esports-left h2 {
    color: #ffd700;
    margin-bottom: 10px;
    font-size: 1.5em;
}

/* 图片样式 */
.sports-left img,
.esports-right img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.sports-left img:hover,
.esports-right img:hover {
    transform: scale(1.05);
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    /* Showcase和Carousel布局 */
    .showcase {
        height: auto;
        min-height: 60vh;
        padding: 20px 0;
    }

    .showcase-container {
        padding: 0 10px;
    }

    .carousel {
        display: grid;
        grid-template-columns: repeat(4, 1fr); /* 第一行4个 */
        grid-template-rows: repeat(2, auto); /* 两行 */
        gap: 15px;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        transform: none;
    }

    .carousel-item {
        position: relative; /* 取消绝对定位 */
        width: 80px;
        height: 80px;
        transform: none !important; /* 禁用transform动画 */
    }

    .carousel-item:nth-child(5),
    .carousel-item:nth-child(6),
    .carousel-item:nth-child(7) {
        grid-column: span 1;
    }

    .carousel-item:nth-last-child(-n+3) {
        margin: 0 auto;
    }

    .carousel-item.active {
        width: 200px; /* 减小活动项的大小 */
        height: 200px;
    }

    .image-wrapper {
        border-radius: 10px;
        width: 100%;
        height: 100%;
    }

    .image-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* 新闻部分紧凑化 */
    .news-section {
        margin-top: -30px; /* 减少与showcase的间距 */
    }

    /* 新闻区域布局 */
    .news-section {
        min-height: auto;
        padding: 20px 0;
    }

    .news-container {
        flex-direction: column;
        align-items: center;
        height: auto;
        padding: 20px;
        gap: 30px;
    }

    .news-left, .news-right {
        width: 100%;
        max-width: 100%;
        padding: 0;
        text-align: center; 
    }

    .news-center {
        transform: none;
        padding: 20px 0;
        order: -1; /* 将logo移到最上方 */
    }

    .news-logo {
        width: 200px;
    }

    .news-text {
        font-size: 32px;
    }

    .news-nav {
        justify-content: center;
    }

    .news-btn {
        padding: 8px 15px;
        font-size: 14px;
    }

    .news-item {
        height: 100px;
    }

    .news-item-img {
        width: 100px;
        height: 100px;
    }

    .news-item-title {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .news-item-excerpt {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    /* 体育和电竞模块 */
    .sports-section,
    .esports-section {
        min-height: auto;
        padding: 40px 0;
    }

    .sports-container,
    .esports-container {
        flex-direction: column;
        padding: 20px;
        gap: 30px;
    }

    .sports-left img,
    .esports-right img {
        max-width: 100%;
        height: auto;
    }

    .section-logo {
        width: 200px;
    }

    .section-text {
        font-size: 32px;
    }

    .sports-right h2,
    .esports-left h2 {
        font-size: 18px;
        text-align: center;
    }

    .sports-right p,
    .esports-left p {
        font-size: 14px;
        text-align: justify;
        padding: 0 15px;
    }

    /* 其他文本调整 */
    .news-item-more {
        font-size: 12px;
        bottom: 10px;
        right: 10px;
    }
}

/* 针对更小屏幕的额外优化 */
@media screen and (max-width: 480px) {
    .news-logo {
        width: 160px;
    }

    .news-text,
    .section-text {
        font-size: 28px;
    }

    .carousel {
        transform: scale(0.6);
    }

    .news-item {
        height: 90px;
    }

    .news-item-img {
        width: 90px;
        height: 90px;
    }

    .news-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}
