/* 服务分类展示区 */
.service-category {
    background: #f5f7fa;
    padding-bottom: 0px;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 60px;
    flex-wrap: wrap;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
}

.category-tab {
    display: flex;
    flex-direction: row;
    /* 横向排列更紧凑 */
    align-items: center;
    gap: 12px;
    padding: 15px 30px;
    border-radius: 50px;
    /* 药丸形状 */
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    border: 1px solid #eee;
    min-width: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.category-tab i {
    font-size: 18px;
    /* 稍微调小图标 */
    color: #666;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.category-tab span {
    font-size: 15px;
    color: #555;
    text-align: center;
    font-weight: 500;
}

.category-tab:hover {
    background: #fff;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(52, 152, 219, 0.15);
}

.category-tab:hover i {
    color: #3498db;
    transform: scale(1.1);
}

.category-tab.active {
    background: linear-gradient(135deg, #2c58a5 0%, #3498db 100%);
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(44, 88, 165, 0.4);
    transform: translateY(-2px);
}

.category-tab.active i,
.category-tab.active span {
    color: white;
}

/* 子分类展示区 - 轮播图 */
.subcategory-display {
    position: relative;
    min-height: 450px;
}

.subcategory-content {
    display: none;
}

.subcategory-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 轮播图容器 */
.carousel-container {
    position: relative;
    overflow: visible;
    /* 允许阴影和按钮溢出 */
    padding: 0 40px;
    /* 减小内边距，让内容区域更大 */
    max-width: 1200px;
    margin: 0 auto;
}

.subcategory-grid {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    /* 更平滑的曲线 */
    gap: 30px;
    /* 增加卡片间距 */
    padding: 10px 0 40px 0;
    /* 底部padding留给阴影 */
}

/* 左右切换按钮 - 悬浮简约风格 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    /* 更大 */
    height: 60px;
    background: white;
    border: none;
    /* 移除边框 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    /* 柔和阴影 */
    opacity: 0.8;
}

.carousel-btn:hover {
    background: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-50%) scale(1.1);
    opacity: 1;
}

.carousel-btn i {
    font-size: 24px;
    color: #444;
    /* 深灰色图标 */
    transition: all 0.3s ease;
}

.carousel-btn:hover i {
    color: #2c58a5;
    /* 悬停变品牌色 */
}

/* 将按钮拉到更靠边的位置，稍微悬出容器 */
.carousel-btn.prev {
    left: -30px;
}

.carousel-btn.next {
    right: -30px;
}

.carousel-btn:disabled {
    opacity: 0;
    /* 直接隐藏禁用的按钮，更清爽 */
    pointer-events: none;
}

/* 卡片样式升级 */
.subcategory-card {
    background: white;
    border-radius: 20px;
    /* 更大的圆角 */
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    /* 高级感阴影 */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 0 0 100%;
    min-width: 100%;
    position: relative;
}

.subcategory-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(44, 88, 165, 0.15);
}

.subcategory-image {
    width: 100%;
    height: 480px;
    /* 保持高度 */
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    /* 背景色 */
}

/* 图片遮罩 - 调整大小以匹配图片，或者移除，这里先调整 */
.subcategory-image::after {
    content: '';
    position: absolute;
    bottom: 10%;
    /* 调整位置匹配图片 */
    left: 10%;
    width: 80%;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.05) 0%, transparent 100%);
    pointer-events: none;
    border-radius: 0 0 12px 12px;
    /* 匹配图片的圆角 */
}

.subcategory-image img {
    width: 80%;
    height: 80%;
    object-fit: cover;
    border-radius: 12px;
    /* 给图片加个圆角，因为这不再是全屏填充了 */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    /* 给图片加个阴影 */
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.subcategory-card:hover .subcategory-image img {
    transform: scale(1.05);
    /* 稍微缩小放大比例 */
}

.subcategory-info {
    padding: 35px 40px;
    /* 更大的内边距 */
    text-align: center;
    /* 以及居中对齐 */
    background: #fff;
    position: relative;
    z-index: 2;
}

.subcategory-info h3 {
    font-size: 24px;
    /* 更大标题 */
    margin-bottom: 15px;
    color: #222;
    font-weight: 700;
    background: linear-gradient(45deg, #2c58a5, #3498db);
    /* 渐变文字标题 */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.subcategory-info p {
    font-size: 16px;
    line-height: 1.8;
    color: #666;
    margin: 0 auto;
    max-width: 800px;
    /* 限制文字宽度，防止在大屏太长 */
}

/* 装饰性元素 */
.subcategory-info::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: #eee;
    margin: 0 auto 20px auto;
    border-radius: 2px;
}

/* 响应式适配服务分类 */
@media (max-width: 768px) {
    .category-tabs {
        gap: 10px;
        margin-bottom: 30px;
        justify-content: flex-start;
        /* 移动端左对齐并支持横向滚动（如果需要） */
        overflow-x: auto;
        padding-bottom: 10px;
        /* 为滚动条留空间 */
        flex-wrap: nowrap;
        /* 不换行，横向滚动 */
        -webkit-overflow-scrolling: touch;
        padding-left: 10px;
        /* 增加一点左padding */
    }

    .category-tabs::-webkit-scrollbar {
        display: none;
        /* 隐藏滚动条 */
    }

    .category-tab {
        min-width: auto;
        padding: 10px 20px;
        white-space: nowrap;
        /* 防止文字换行 */
        border-radius: 30px;
    }

    .category-tab i {
        font-size: 16px;
    }

    .category-tab span {
        font-size: 13px;
    }

    .carousel-container {
        padding: 0 0;
        /* 移动端卡片全宽，不要padding */
    }

    .subcategory-card {
        border-radius: 12px;
        /* 移动端圆角小一点 */
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    }

    .carousel-btn {
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.9);
        /* 半透明背景 */
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .carousel-btn i {
        font-size: 16px;
    }

    .carousel-btn.prev {
        left: 0;
        /* 移动端贴边，但不悬出 */
    }

    .carousel-btn.next {
        right: 0;
    }

    .subcategory-image {
        height: 250px;
        /* 移动端高度 */
    }

    .subcategory-info {
        padding: 20px;
    }

    .subcategory-info h3 {
        font-size: 18px;
    }
}