/* 圖片優化樣式 */

/* 圖片淡入效果 */
img {
    transition: opacity 0.5s ease-in-out;
}

img[data-src] {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}

/* 圖片容器樣式，防止圖片加載時頁面跳動 */
.img-container {
    position: relative;
    overflow: hidden;
    background-color: #f0f0f0;
}

/* 圖片佔位符樣式 */
.img-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 14px;
}

/* 圖片加載中動畫 */
.img-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 優化不同類型圖片的顯示 */
.hero-bg {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.about-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.icon-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.expertise-img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
}

.contact-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 響應式圖片優化 */
@media (max-width: 768px) {
    .icon-img {
        width: 48px;
        height: 48px;
    }
    
    .expertise-img {
        max-height: 150px;
    }
}