/* Services Section Styles  */
.services-section {
    padding: 50px 0;
    position: relative;
    background: #fff;
}

.services-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.services-header {
    text-align: center;
    margin-bottom: 60px;
}

.services-subtitle {
    font-size: 14px;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    font-weight: 600;
    display: block;
}

.services-title {
    font-size: 36px;
    color: #333;
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
    position: relative;
}

.services-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #667eea;
}

/* Services Grid */
.services-grid {
    display: grid;
    gap: 30px;
}

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

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

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

/* Service Item */
.service-item {
    position: relative;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    cursor: pointer;
}

.service-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.service-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.6s ease;
    z-index: 1;
}

.service-item:hover .service-bg {
    transform: scale(1.1);
}

.service-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
    z-index: 2;
    transition: all 0.4s ease;
}

.service-item:hover .service-overlay {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
}

.service-content {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 30px;
    color: #fff;
}

.service-icon {
    margin-bottom: 20px;
    transition: all 0.4s ease;
}

.service-icon-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: all 0.4s ease;
}

.service-item:hover .service-icon {
    transform: translateY(-10px);
}

.service-item:hover .service-icon-img {
    transform: scale(1.1);
}

.service-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #fff;
    transition: all 0.4s ease;
}

.service-item:hover .service-title {
    transform: translateY(-5px);
}

.service-hover-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

.service-item:hover .service-hover-content {
    max-height: 200px;
    opacity: 1;
}

.service-description {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(20px);
    transition: all 0.4s ease 0.1s;
}

.service-item:hover .service-description {
    transform: translateY(0);
}

.service-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    transition: all 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
}

.service-item:hover .service-link {
    transform: translateY(0);
    opacity: 1;
    transition-delay: 0.2s;
}

.service-link:hover {
    background: #fff;
    color: #667eea;
    border-color: #fff;
}

.service-link svg {
    transition: transform 0.3s ease;
}

.service-link:hover svg {
    transform: translateX(3px);
}

/* 占位图片样式 */
.service-bg[style*="placeholder-bg.jpg"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.service-bg[style*="placeholder-bg.jpg"]::before {
    content: 'Background Image';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
}

.service-icon-img[src*="placeholder-icon.png"] {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 15px;
    width: 50px;
    height: 50px;
}

/* 动画关键帧 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.service-item:nth-child(1) { animation-delay: 0.1s; }
.service-item:nth-child(2) { animation-delay: 0.2s; }
.service-item:nth-child(3) { animation-delay: 0.3s; }
.service-item:nth-child(4) { animation-delay: 0.4s; }
.service-item:nth-child(5) { animation-delay: 0.5s; }
.service-item:nth-child(6) { animation-delay: 0.6s; }

/* 响应式设计 */
@media (max-width: 1024px) {
    .services-grid.grid-3,
    .services-grid.grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .services-section {
        padding: 60px 0;
    }
    
    .services-title {
        font-size: 28px;
    }
    
    .services-grid.grid-3,
    .services-grid.grid-4,
    .services-grid.grid-2 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* ===== 移动端自适应修改 ===== */
    .service-item {
        height: auto;                /* 高度由内容撑开 */
        min-height: 250px;           /* 保留最小高度 */
        overflow: visible;           /* 确保内容不被裁剪 */
    }
    
    /* 描述区域始终可见，取消悬停限制 */
    .service-hover-content {
        max-height: none !important;
        opacity: 1 !important;
        overflow: visible;
    }
    
    /* 描述文字和链接恢复原位，无偏移 */
    .service-description,
    .service-link {
        transform: translateY(0) !important;
        opacity: 1 !important;
    }
    
    /* 调整内边距，适配移动端 */
    .service-content {
        padding: 20px;
    }
    
    .service-icon-img {
        width: 50px;
        height: 50px;
    }
    
    .services-header {
        margin-bottom: 40px;
    }
}

@media (max-width: 480px) {
    .services-container {
        padding: 0 15px;
    }
    
    .services-title {
        font-size: 24px;
    }
    
    .service-item {
        min-height: 220px;            /* 更小屏幕的最小高度 */
    }
    
    .service-content {
        padding: 20px;
    }
    
    .service-icon-img {
        width: 50px;
        height: 50px;
    }
    
    .service-title {
        font-size: 18px;
    }
}