/**
 * 面包屑导航修复和照片占位符替换
 * Breadcrumb Fix and Image Placeholders
 */

/* ========================================
   面包屑导航修复
   ======================================== */

/* 确保面包屑在 Page Header 中正确定位 */
.page-header-content {
    position: relative;
    z-index: 2;
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1rem;
    opacity: 0.9;
    flex-wrap: wrap;
    padding: 0 20px;
    margin-top: 15px;
    list-style: none;
}

.breadcrumb a {
    color: var(--bg-white);
    transition: var(--transition);
    text-decoration: none;
    font-weight: 400;
}

.breadcrumb a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.breadcrumb i {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.breadcrumb span {
    color: rgba(255, 255, 255, 0.7);
}

/* 移动端面包屑优化 */
@media (max-width: 768px) {
    .breadcrumb {
        gap: 8px;
        font-size: 0.9rem;
        padding: 0 15px;
    }
    
    .breadcrumb i {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .breadcrumb {
        gap: 6px;
        font-size: 0.85rem;
    }
}

/* ========================================
   图片占位符替换为 img 标签
   ======================================== */

/* 通用图片样式 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 产品图片占位符 */
.product-image .image-placeholder,
.category-image .image-placeholder,
.news-image .image-placeholder,
.related-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--bg-white);
}

/* 当使用真实图片时 */
.product-image img,
.category-image img,
.news-image img,
.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 主图占位符 */
.image-placeholder-large {
    width: 100%;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--bg-white);
    border-radius: var(--border-radius-lg);
}

/* 真实主图 */
.image-placeholder-large img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    border-radius: var(--border-radius-lg);
}

/* 移动端主图高度 */
@media (max-width: 768px) {
    .image-placeholder-large {
        height: 300px;
    }
    
    .image-placeholder-large img {
        height: 300px;
    }
}

/* 缩略图 */
.thumbnail {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--primary-color);
}

/* 博客文章图片 */
.post-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.post-image .image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--bg-white);
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 作者头像 */
.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--bg-white);
    font-size: 2.5rem;
    overflow: hidden;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 认证图标 */
.cert-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-hover));
    color: var(--bg-white);
    font-size: 2.5rem;
}

.cert-icon img {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

/* 应用图标 */
.app-icon,
.why-icon,
.capability-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.app-icon img,
.why-icon img,
.capability-icon img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

/* ========================================
   图片加载优化
   ======================================== */

/* 懒加载图片 */
img[loading="lazy"] {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

/* 图片加载失败时的样式 */
img:not([src]),
img[src=""] {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
}

img:not([src])::before,
img[src=""]::before {
    content: '📷';
    font-size: 3rem;
    opacity: 0.5;
}

/* ========================================
   响应式图片
   ======================================== */

@media (max-width: 768px) {
    .post-image {
        height: 200px;
    }
    
    .image-placeholder-large {
        height: 300px;
    }
    
    .thumbnail-gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .post-image {
        height: 180px;
    }
    
    .image-placeholder-large {
        height: 250px;
    }
}

/* ========================================
   图片悬停效果
   ======================================== */

.product-image,
.category-image,
.news-image {
    overflow: hidden;
}

.product-image img,
.category-image img,
.news-image img {
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img,
.product-category-card:hover .category-image img,
.news-card:hover .news-image img {
    transform: scale(1.1);
}

/* ========================================
   图片 overlay 效果
   ======================================== */

.product-overlay,
.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 51, 102, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}

.product-card:hover .product-overlay,
.product-category-card:hover .category-overlay {
    opacity: 1;
}

/* 确保 overlay 在图片上方 */
.product-image img,
.category-image img {
    position: relative;
    z-index: 1;
}
