/* ===== 产品列表页面布局修复样式 ===== */
/* 解决中文版左对齐问题和英文版标签显示异常问题 */

/* 重置所有产品卡片的基础样式 */
.product-card {
    background: white !important;
    border-radius: 15px !important;
    overflow: hidden !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: row !important;
    height: auto !important;
    min-height: 220px !important;
    max-height: none !important;
    position: relative !important;
    border: 1px solid rgba(0,86,179,0.1) !important;
}

.product-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15) !important;
}

/* 产品图片容器样式 */
.product-image-container {
    flex: 0 0 40% !important;
    position: relative !important;
    overflow: hidden !important;
    min-height: 200px !important;
    max-height: 250px !important;
}

.product-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.product-card:hover .product-image {
    transform: scale(1.05) !important;
}

.product-image-placeholder {
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-size: 2rem !important;
}

/* 产品信息容器 - 核心修复 */
.product-info {
    flex: 1 !important;
    padding: 12px 15px 8px 15px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    position: relative !important;
    z-index: 1 !important;
    min-height: 200px !important;
    max-height: none !important;
    overflow: visible !important;
    background-color: white !important;
    text-align: left !important;
    align-items: flex-start !important;
}

/* 产品标题样式 - 统一修复 */
.product-title {
    display: block !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin-bottom: 10px !important;
    line-height: 1.3 !important;
    word-break: break-word !important;
    position: relative !important;
    z-index: 10 !important;
    height: auto !important;
    min-height: 40px !important;
    max-height: 52px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    text-align: left !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 英文界面标题显示优化 */
[lang="en"] .product-title {
    font-size: 1rem !important;
    line-height: 1.3 !important;
    margin-bottom: 12px !important;
    word-break: break-word !important;
    position: relative !important;
    z-index: 2 !important;
    text-align: left !important;
    display: block !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    -webkit-line-clamp: none !important;
    -webkit-box-orient: horizontal !important;
    width: 100% !important;
}

/* 产品简介样式 - 强制左对齐修复 */
.product-summary {
    color: #7f8c8d !important;
    font-size: 0.8rem !important;
    line-height: 1.3 !important;
    margin-bottom: 8px !important;
    position: relative !important;
    z-index: 3 !important;
    white-space: normal !important;
    flex: 1 !important;
    text-align: left !important;
    left: 0 !important;
    right: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-height: 50px !important;
    min-height: 50px !important;
}

/* 英文界面简介显示优化 - 强制左对齐 */
[lang="en"] .product-summary {
    line-height: 1.4 !important;
    font-size: 0.85rem !important;
    margin-bottom: 18px !important;
    flex-shrink: 0 !important;
    text-align: left !important;
    left: 0 !important;
    right: auto !important;
    position: relative !important;
    z-index: 2 !important;
    display: block !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    -webkit-line-clamp: none !important;
    -webkit-box-orient: horizontal !important;
    width: 100% !important;
    max-height: none !important;
    height: auto !important;
}

/* 产品卡片底部容器样式 - 按钮显示修复 */
.product-footer {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: auto !important;
    padding: 15px 0 5px 0 !important;
    border-top: 1px solid rgba(0,86,179,0.1) !important;
    position: relative !important;
    z-index: 4 !important;
    width: 100% !important;
    gap: 10px !important;
    background-color: white !important;
    min-height: 50px !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
}

/* 英文界面产品卡片底部样式优化 */
[lang="en"] .product-footer {
    padding-top: 15px !important;
    position: relative !important;
    z-index: 4 !important;
    background-color: white !important;
    min-height: 40px !important;
}

/* 产品分类标签样式 */
.product-category {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 15px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    position: relative !important;
    z-index: 5 !important;
}

/* 产品链接按钮样式 - 确保完全可见且文字居中 */
.product-link,
a.product-link,
.product-footer .product-link,
.product-card .product-footer .product-link,
.product-info .product-footer .product-link {
    /* 使用 flexbox 居中 */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    /* 尺寸和间距 */
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
    
    /* 字体设置 */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    letter-spacing: 0.3px !important;
    
    /* 微调：向上偏移1px来补偿字体基线 */
    transform: translateY(-1px) !important;
    
    /* 重置可能影响居中的属性 */
    margin: 0 !important;
    border: none !important;
    outline: none !important;
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    vertical-align: middle !important;
    text-align: center !important;
    
    /* 背景和颜色 */
    background: linear-gradient(135deg, #0056b3, #004494) !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 12px !important;
    
    /* 其他属性 */
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    min-width: 80px !important;
    max-width: 120px !important;
    z-index: 1000 !important;
    flex-shrink: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.product-link:hover,
.product-link:focus,
.product-link:active {
    background: linear-gradient(135deg, #004494, #003875) !important;
    color: white !important;
    text-decoration: none !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 3px 10px rgba(0,86,179,0.3) !important;
}

/* 确保按钮内的文本不被其他样式影响 */
.product-link *,
.product-link::before,
.product-link::after {
    line-height: 1 !important;
    vertical-align: baseline !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline !important;
    transform: none !important;
}

/* 英文界面按钮显示优化 */
[lang="en"] .product-link,
[lang="en"] a.product-link,
[lang="en"] .product-footer .product-link {
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    font-size: 0.75rem !important;
    min-width: 80px !important;
    max-width: 120px !important;
    transform: translateY(-1px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

[lang="en"] .product-link:hover {
    transform: translateY(-2px) !important;
}

/* 响应式设计优化 */
@media (max-width: 992px) {
    .product-card {
        min-height: 200px !important;
    }
    
    .product-info {
        padding: 10px 12px 6px 12px !important;
        min-height: 200px !important;
    }
    
    .product-title {
        font-size: 0.95rem !important;
        margin-bottom: 8px !important;
        min-height: 35px !important;
        max-height: 45px !important;
    }
    
    .product-summary {
        font-size: 0.75rem !important;
        margin-bottom: 6px !important;
        max-height: 45px !important;
        min-height: 45px !important;
        -webkit-line-clamp: 3 !important;
    }
}

@media (max-width: 768px) {
    .product-card {
        flex-direction: column !important;
        height: auto !important;
        min-height: auto !important;
    }
    
    .product-image-container {
        flex: 0 0 180px !important;
        width: 100% !important;
        min-height: 180px !important;
        max-height: 180px !important;
    }
    
    .product-info {
        padding: 15px !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .product-title {
        font-size: 1rem !important;
        margin-bottom: 10px !important;
        min-height: auto !important;
        max-height: none !important;
        -webkit-line-clamp: 3 !important;
    }
    
    .product-summary {
        font-size: 0.85rem !important;
        margin-bottom: 15px !important;
        min-height: auto !important;
        max-height: none !important;
        -webkit-line-clamp: 4 !important;
    }
    
    .product-footer {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
        min-height: auto !important;
    }
    
    .product-link {
        width: 100% !important;
        min-width: auto !important;
    }
}

@media (max-width: 480px) {
    .product-info {
        padding: 12px !important;
    }
    
    .product-title {
        font-size: 0.95rem !important;
        margin-bottom: 8px !important;
    }
    
    .product-summary {
        font-size: 0.8rem !important;
        margin-bottom: 12px !important;
    }
}

@media (max-width: 576px) {
    .product-card {
        margin: 0 -15px !important;
        border-radius: 15px !important;
    }
    
    .product-info {
        padding: 12px !important;
    }
}

/* 产品网格容器优化 */
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 25px !important;
    margin-top: 30px !important;
}

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
        gap: 20px !important;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        margin-top: 20px !important;
    }
}

/* 确保所有文本内容左对齐 */
.product-info * {
    text-align: left !important;
}

/* 防止样式被其他CSS覆盖 */
.product-card .product-info .product-title,
.product-card .product-info .product-summary,
.product-card .product-info .product-footer .product-link {
    position: relative !important;
    z-index: 999 !important;
}

/* 修复可能的布局冲突 */
.product-card * {
    box-sizing: border-box !important;
}

/* 确保按钮在所有情况下都可见 */
.product-footer .product-link {
    background: linear-gradient(135deg, #0056b3, #004494) !important;
    border: 2px solid transparent !important;
    outline: none !important;
}

.product-footer .product-link:focus,
.product-footer .product-link:active {
    background: linear-gradient(135deg, #004494, #003875) !important;
    border-color: #0056b3 !important;
}