/* ===== 产品列表页重新设计 - 与项目UI规范完全一致 ===== */
/* 基于项目现有配色方案和设计风格 */

/* CSS变量 - 与项目主样式保持一致 */
:root {
    --primary-blue: #1e3a8a;
    --secondary-blue: #0056b3;
    --accent-blue: #004494;
    --deep-blue: #003875;
    --text-dark: #212529;
    --text-medium: #495057;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-light: #e9ecef;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 15px rgba(0,86,179,0.15);
    --shadow-lg: 0 10px 30px rgba(0,86,179,0.2);
    --radius-sm: 12px;
    --radius-md: 15px;
    --radius-lg: 20px;
    --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-smooth: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 重置并重新设计产品网格容器 */
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)) !important;
    gap: 30px !important;
    margin-top: 30px !important;
    padding: 0 !important;
}

/* 产品卡片主体设计 - 确保四个角都有圆角 */
.product-card {
    background: var(--bg-white) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: var(--transition-smooth) !important;
    display: flex !important;
    flex-direction: row !important;
    overflow: hidden !important;
    border: 1px solid var(--border-light) !important;
    height: auto !important;
    min-height: 260px !important;
    max-height: none !important;
    position: relative !important;
    width: 100% !important;
    opacity: 0 !important;
    transform: translateY(20px) !important;
}

/* 产品卡片加载完成状态 */
.product-card.loaded {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* 悬停效果 - 平滑滑动而非跳动 */
.product-card:hover {
    transform: translateY(-6px) scale(1.02) !important;
    box-shadow: 0 12px 35px rgba(0,86,179,0.18) !important;
    border-color: rgba(0, 86, 179, 0.4) !important;
}

/* 产品图片容器 */
.product-image-container {
    flex: 0 0 45% !important;
    position: relative !important;
    overflow: hidden !important;
    background: var(--bg-light) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 260px !important;
}

/* 产品图片样式 */
.product-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: var(--transition) !important;
}

.product-card:hover .product-image {
    transform: scale(1.05) !important;
}

/* 图片占位符 */
.product-image-placeholder {
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(135deg, var(--secondary-blue), var(--accent-blue)) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-size: 3rem !important;
}

/* 产品信息容器 */
.product-info {
    flex: 1 !important;
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    background: var(--bg-white) !important;
    position: relative !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

/* 产品标题 */
.product-title {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: var(--text-dark) !important;
    margin-bottom: 12px !important;
    line-height: 1.4 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-height: 50px !important;
}

.product-title:hover {
    color: var(--secondary-blue) !important;
}

/* 产品简介 */
.product-summary {
    color: var(--text-light) !important;
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: left !important;
    flex: 1 !important;
    min-height: 60px !important;
}

/* 产品底部容器 */
.product-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: auto !important;
    padding-top: 15px !important;
    border-top: 1px solid var(--border-light) !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
}

/* 产品分类标签 */
.product-category {
    background: linear-gradient(135deg, var(--secondary-blue), var(--accent-blue)) !important;
    color: white !important;
    padding: 6px 10px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100px !important;
    flex-shrink: 1 !important;
}

/* 查看详情按钮 */
.product-link {
    background: linear-gradient(135deg, var(--secondary-blue), var(--accent-blue)) !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 90px !important;
    max-width: 120px !important;
    height: 32px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}

.product-link:hover {
    background: linear-gradient(135deg, var(--accent-blue), var(--deep-blue)) !important;
    color: white !important;
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 6px 20px rgba(0,86,179,0.3) !important;
}

.product-link:active {
    transform: translateY(0) !important;
}

/* 响应式设计 - 平板设备 */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
        gap: 25px !important;
    }
    
    .product-card {
        min-height: 240px !important;
    }
    
    .product-info {
        padding: 20px !important;
    }
}

/* 响应式设计 - 移动设备 */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        margin-top: 20px !important;
    }
    
    .product-card {
        flex-direction: column !important;
        min-height: auto !important;
        max-height: none !important;
    }
    
    .product-image-container {
        flex: 0 0 200px !important;
        width: 100% !important;
        min-height: 200px !important;
        max-height: 200px !important;
    }
    
    .product-info {
        padding: 20px !important;
        min-height: auto !important;
    }
    
    .product-title {
        font-size: 1rem !important;
        min-height: 40px !important;
    }
    
    .product-summary {
        font-size: 0.85rem !important;
        -webkit-line-clamp: 2 !important;
        min-height: 45px !important;
        margin-bottom: 15px !important;
    }
    
    .product-footer {
        flex-direction: row !important;
        gap: 10px !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    
    .product-category {
        max-width: 80px !important;
        font-size: 0.65rem !important;
        padding: 4px 8px !important;
        flex-shrink: 1 !important;
    }
    
    .product-link {
        min-width: 80px !important;
        max-width: 100px !important;
        font-size: 0.75rem !important;
        padding: 6px 12px !important;
        height: 30px !important;
        flex-shrink: 0 !important;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .products-grid {
        gap: 15px !important;
    }
    
    .product-card {
        margin: 0 -5px !important;
        border-radius: var(--radius-md) !important; /* 保持圆角 */
    }
    
    .product-info {
        padding: 15px !important;
    }
    
    .product-footer {
        gap: 8px !important;
    }
    
    .product-category {
        max-width: 60px !important;
        font-size: 0.6rem !important;
        padding: 3px 6px !important;
    }
    
    .product-link {
        font-size: 0.7rem !important;
        padding: 6px 10px !important;
        min-width: 70px !important;
        max-width: 90px !important;
        height: 28px !important;
    }
}

/* 懒加载动画 - 平滑优雅的加载效果 */
@keyframes smoothFadeInUp {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    50% {
        opacity: 0.5;
        transform: translateY(20px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 骨架屏效果 */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.product-card.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;
    background-size: 200px 100% !important;
    animation: shimmer 1.5s infinite !important;
}

.product-card.loaded {
    animation: smoothFadeInUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards !important;
}

/* 交错加载效果 */
.product-card:nth-child(1).loaded { animation-delay: 0.1s !important; }
.product-card:nth-child(2).loaded { animation-delay: 0.2s !important; }
.product-card:nth-child(3).loaded { animation-delay: 0.3s !important; }
.product-card:nth-child(4).loaded { animation-delay: 0.4s !important; }
.product-card:nth-child(5).loaded { animation-delay: 0.5s !important; }
.product-card:nth-child(6).loaded { animation-delay: 0.6s !important; }

/* 确保所有元素都有正确的盒模型 */
.product-card,
.product-card * {
    box-sizing: border-box !important;
}

/* 强制覆盖任何可能的冲突样式 */
.products-grid .product-card,
.container .product-card,
.row .product-card {
    border-radius: var(--radius-md) !important;
    overflow: hidden !important;
}

/* 特殊情况处理 - 确保在所有情况下都保持圆角 */
@media screen and (min-width: 1px) {
    .product-card {
        border-radius: var(--radius-md) !important;
    }
}