/* ===== 首页样式 ===== */
.main-content {
    margin-top: 100px;
    padding: 20px 0;
}

/* 顶部广告区域样式 */
.top-ad-section {
    margin-bottom: 20px;
}

/* 中部横幅广告样式 */
.middle-banner-section {
    margin: 15px 0;
}

.middle-banner {
    overflow: hidden;
    transition: transform 0.3s ease;
}

.middle-banner:hover {
    transform: translateY(-3px);
}

.middle-banner img {
    display: block;
}

/* 广告区域通用样式 */
.ad-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #2c3e50;
    padding-bottom: 10px;
    border-bottom: 2px solid #eaeaea;
}

.ad-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.ad-item {
    border-radius: 10px;
    padding: 20px 10px;
    text-align: center;
    color: #fff;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

.ad-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.ad-item i {
    font-size: 24px;
    margin-bottom: 10px;
}

.ad-item .ad-text {
    font-size: 12px;
    font-weight: 500;
}

.ad-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
}

.ad-red {
    background: linear-gradient(135deg, #ef4444, #f97316);
}

.ad-blue {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.ad-green {
    background: linear-gradient(135deg, #10b981, #14b8a6);
}

.ad-purple {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

.ad-yellow {
    background: linear-gradient(135deg, #eab308, #f59e0b);
}

.ad-indigo {
    background: linear-gradient(135deg, #6366f1, #3b82f6);
}

.ad-pink {
    background: linear-gradient(135deg, #ec4899, #f97316);
}

.ad-cyan {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
}

.banner-ad {
    position: relative;
}

.banner-content {
    padding: 30px;
    color: #fff;
    position: relative;
    z-index: 2;
}

.banner-content h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.banner-content p {
    margin-bottom: 15px;
    opacity: 0.9;
}

.banner-btn {
    background: #fff;
    color: #3b82f6;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.banner-btn:hover {
    background: #f3f4f6;
}

/* 轮播区域*/
.banner-swiper {
    width: 100%;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    position: relative;
    margin-bottom: 20px;
}

.banner-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background-color: #fafafa;
}

.banner-swiper .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #e5e5e5;
    opacity: 1;
    border-radius: 8px;
    transition: all 0.3s;
}

.banner-swiper .swiper-pagination-bullet-active {
    background: #ff2442;
    width: 20px;
}

/* 服务分类 */
.service-section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 24px;
    color: #333;
    margin-right: 10px;
}

.section-header i {
    color: #3b82f6;
    font-size: 20px;
}

.section-subtitle {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.service-item {
    background: #fff;
    border-radius: 10px;
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    text-decoration: none !important;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.service-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    color: #fff;
    font-size: 20px;
}

.service-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

/* 分类数据区域 */
.data-section {
    margin-bottom: 30px;
}

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

.data-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
}

.card-header h3 i {
    color: #3b82f6;
    margin-right: 8px;
}

.view-more {
    color: #3b82f6;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.3s;
}

.view-more:hover {
    color: #2563eb;
}

.data-list {
    padding: 10px 0;
}

.data-item {
    padding: 15px 15px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.3s;
}

.data-item:hover {
    background: #f9fafb;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
}

.text-wrap {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-time {
    font-size: 12px;
    color: #6b7280;
}

/* 分类数据区域排名颜色设置 */
.data-item .hot-rank {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    margin-right: 8px;
    flex-shrink: 0;
    color: white;
}

/* 第1名 - 红色 */
.data-item-link:nth-child(1) .hot-rank {
    background-color: #ff5252;
}

/* 第2名 - 橘黄色 */
.data-item-link:nth-child(2) .hot-rank {
    background-color: #ff9800;
}

/* 第3名 - 天蓝色 */
.data-item-link:nth-child(3) .hot-rank {
    background-color: #03a9f4;
}

/* 第4名 - 浅绿色 */
.data-item-link:nth-child(4) .hot-rank {
    background-color: #4caf50;
}

/* 第5名 - 紫色 */
.data-item-link:nth-child(5) .hot-rank {
    background-color: #9c27b0;
}

/* 第6名 - 粉色 */
.data-item-link:nth-child(6) .hot-rank {
    background-color: #e91e63;
}

/* 第7名 - 青色 */
.data-item-link:nth-child(7) .hot-rank {
    background-color: #009688;
}

/* 第8名及以后 - 灰色 */
.data-item-link:nth-child(n+8) .hot-rank {
    background-color: #9e9e9e;
}

.new_card {
    width: 100%;
    margin: 0 auto;
    background: #fff;
    padding: 15px;
    box-sizing: border-box;
    border-radius: 15px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid rgb(229, 231, 235);
    margin-bottom: 10px;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
}

.card-header h3 i {
    margin-right: 6px;
}

.update-count {
    font-size: 14px;
    color: #666;
}

.update-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    /* 保证父容器宽度自适应 */
    box-sizing: border-box;
    overflow: hidden;
}

.update-item-link {
    display: block;
    width: calc(33% - 5px);
    box-sizing: border-box;
    text-decoration: none;
    color: #000;
}

.update-item {
    display: flex;
    padding: 8px;
    gap: 8px;
}

.item-icon i {
    font-size: 20px;
    color: #1890ff;
}

.item-content {
    flex: 1;
    overflow: hidden;
}

.item-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    overflow: hidden;
}

.item-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 8px;
}

/* 分页 */
.module_page {
    margin-top: 15px;
    height: 35px;
    position: relative;
    overflow: hidden;
    display: flex;
    background: #fff;
    padding: 2px 0;
}

.module_page .prev,
.module_page .next {
    flex: 1;
    border: 1px solid #efefef;
    text-align: center;
    line-height: 33px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.module_page .prev:hover,
.module_page .next:hover {
    background: linear-gradient(45deg, #1e69e0, #6db3f2);
    /* 深蓝渐变 */
}

.module_page .location {
    width: 80px;
    height: 30px;
    background: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-42deg);
    z-index: 1;
    box-sizing: border-box;
    border-top: 1px solid #efefef;
    border-bottom: 1px solid #efefef;
}

/* 首页响应式设计 */
@media (min-width: 768px) {
    .service-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (min-width: 640px) {
    .data-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .data-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .ad-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }

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

    .update-item:nth-child(odd) {
        border-right: none;
    }

    .update-item:nth-last-child(2) {
        border-bottom: 1px solid #f8f9fa;
    }
}

@media (max-width: 768px) {
    .ad-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .ad-item {
        padding: 15px 8px;
        min-height: 100px;
    }

    .ad-item i {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .ad-item .ad-text {
        font-size: 11px;
    }

    .card-header {
        padding: 14px 16px;
        align-items: flex-start;
        gap: 10px;
    }

    .card-header h3 {
        font-size: 16px;
    }

    .update-item {
        padding: 14px 16px;
    }


    .item-title {
        font-size: 14px;
    }

    /* 响应式排名调整 */
    .data-item .hot-rank {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }

    /* 响应式广告区域调整 */
    .top-ad-section {
        margin-bottom: 20px;
    }

    .middle-banner-section {
        margin: 30px 0;
    }

    .update-item-link {
        width: 100%;
        /* 单列，保证不超出父容器 */
    }
}

@media (max-width: 480px) {
    .ad-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .ad-item {
        padding: 18px 10px;
        min-height: 110px;
    }

    .ad-item i {
        font-size: 22px;
        margin-bottom: 10px;
    }

    .ad-item .ad-text {
        font-size: 12px;
    }
}

@media (max-width: 250px) {
    .ad-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ad-item {
        padding: 20px 15px;
        min-height: 80px;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }

    .ad-item i {
        font-size: 24px;
        margin-bottom: 0;
        margin-right: 15px;
    }

    .ad-item .ad-text {
        font-size: 14px;
    }

    .ad-badge {
        font-size: 10px;
        padding: 2px 5px;
    }
}