/* 页面标题 */
.page-header {
    background: url('../产品中心/产品中心.jpg') center/cover no-repeat;
    color: white;
    text-align: center;
    padding: 120px 20px 60px;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease;
    text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s both;
    text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

.page-header .container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* 提升标题在亮背景图上的可读性 */
.page-header h1,
.page-header p {
    display: inline-block;
    background: rgba(0, 0, 0, 0.35);
    padding: 8px 16px;
    border-radius: 8px;
}

/* 产品分类 */
.product-categories {
    background: #f8f9fa;
    padding: 40px 0;
}

/* 搜索栏样式 */
.search-bar {
    margin-top: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.search-input-wrapper i.fa-search {
    padding: 0 15px;
    color: #666;
    font-size: 1rem;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 0;
    font-size: 1rem;
    background: transparent;
}

.clear-btn {
    background: none;
    border: none;
    padding: 8px 15px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.clear-btn:hover {
    color: #d8b43d;
}

.search-stats {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #666;
}

/* 产品计数样式 */
.tab-btn .count {
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-left: 5px;
}

.tab-btn.active .count {
    background: rgba(255,255,255,0.3);
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    border: 2px solid #d8b43d;
    background: transparent;
    color: #d8b43d;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tab-btn:hover,
.tab-btn.active {
    background: #d8b43d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(216, 180, 61, 0.3);
}

/* 产品列表 */
.products-section {
    padding: 80px 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.product-card {
    background: white;
    border-radius: 20px;
    overflow: visible; /* 避免底部内容被裁剪 */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
    display: flex;             /* 使卡片内布局为列，便于底部对齐 */
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.product-card.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.product-image {
    background: linear-gradient(135deg, #eeeeee, #eeeeee);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden; /* 仅限制图片区域以保持圆角 */
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: inherit;
}

.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.product-card:hover .product-image::before {
    left: 100%;
}

.product-image i {
    font-size: 4rem;
    color: white;
    z-index: 1;
    position: relative;
}

.product-content {
    padding: 30px 30px 28px 30px; /* 增加底部内边距，避免遮挡 */
    display: flex;               /* 内容区列布局，便于将“技术参数”推至底部对齐 */
    flex-direction: column;
    height: 100%;
}

.product-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.product-header h3 {
    font-size: 1.4rem;
    margin: 0;
    color: #2c3e50;
    flex: 1;
}

.product-model {
    background: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.product-unit {
    background: #27ae60;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.product-description {
    margin-bottom: 20px;
}

.product-description p {
    color: #666;
    margin-bottom: 0;
    line-height: 1.6;
    font-size: 0.95rem;
    display: -webkit-box;       /* 限制两行，统一卡片高度（可调） */
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.6em * 2);
}

.product-specs {
    margin-top: auto;            /* 将“技术参数”区域推到底部，横向对齐 */
    margin-bottom: 25px;
}

.product-specs h4 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 10px;
    border-bottom: 2px solid #d8b43d;
    padding-bottom: 5px;
}

.specs-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.specs-list li {
    display: flex;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #555;
    align-items: flex-start;
}

.spec-label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 100px;
    flex-shrink: 0;
}

.specs-detail {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #d8b43d;
    white-space: pre-wrap; /* 保留换行与空白 */
    word-break: break-word; /* 长单词/连续字符串换行 */
}

.specs-detail p {
    margin: 0 0 8px 0;
    line-height: 1.6;
    font-size: 0.9rem;
    color: #555;
}

.specs-detail p:last-child {
    margin-bottom: 0;
}

.specs-detail p strong {
    color: #2c3e50;
    font-weight: 600;
}

.product-examples {
    margin-bottom: 0;
}

.product-examples h4 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 10px;
    border-bottom: 2px solid #27ae60;
    padding-bottom: 5px;
}

.product-examples p {
    margin: 0;
    line-height: 1.6;
    font-size: 0.9rem;
    color: #555;
    background: #f0f8f0;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #27ae60;
}

/* 技术参数折叠功能 */
.spec-toggle {
    width: 100%;
}

.toggle-btn {
    width: 100%;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #d8b43d;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: #d8b43d;
    color: white;
}

.toggle-btn i {
    transition: transform 0.3s ease;
}

.toggle-btn.active i {
    transform: rotate(180deg);
}

.specs-detail-hidden {
    display: none;
    margin-top: 10px;
}

.specs-detail-hidden.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* 技术参数弹框 */
.specs-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.specs-modal-content {
    width: min(900px, 92vw);
    max-height: 86vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
}

.specs-modal-close {
    align-self: flex-end;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.specs-modal-close:hover {
    color: #000;
}

.specs-modal-body {
    margin-top: 10px;
    padding-right: 6px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
}

/* 加工实例单张图片 */
.example-single {
    text-align: center;
    margin-top: 10px;
}

.example-img-single {
    width: 100%;
    max-width: 200px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
}

.example-img-single:hover {
    border-color: #27ae60;
    transform: scale(1.02);
}

.example-caption {
    margin: 8px 0 0 0;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

.product-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.product-actions .btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

/* 产品优势 */
.product-advantages {
    background: #f8f9fa;
    padding: 80px 0;
}

.product-advantages h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #2c3e50;
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.advantage-item {
    text-align: center;
    padding: 30px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

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

.advantage-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #d8b43d, #e7d05e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.advantage-icon i {
    font-size: 2rem;
    color: white;
}

.advantage-item h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.advantage-item p {
    color: #666;
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2.5rem;
    }
    
    .page-header {
        min-height: 260px;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    .category-tabs {
        gap: 8px;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 10px;
    }
    
    .search-bar {
        margin-top: 20px;
        padding: 0 10px;
    }
    
    .search-input {
        font-size: 0.9rem;
        padding: 10px 0;
    }
    
    .pagination {
        flex-direction: column;
        gap: 20px;
    }
    
    .page-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .tab-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .product-content {
        padding: 20px 20px 15px 20px;
    }
    
    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .product-header h3 {
        font-size: 1.2rem;
    }
    
    .product-model,
    .product-unit {
        font-size: 0.8rem;
        padding: 3px 6px;
    }
    
    .spec-label {
        min-width: 80px;
        font-size: 0.85rem;
    }
    
    .specs-list li {
        font-size: 0.85rem;
    }
    
    .specs-detail {
        padding: 12px;
    }
    
    .specs-detail p {
        font-size: 0.85rem;
    }
    
    .product-examples h4 {
        font-size: 1rem;
    }
    
    .product-examples p {
        font-size: 0.85rem;
        padding: 10px;
    }
    
    .example-img-single {
        max-width: 180px;
        height: 100px;
    }
    
    .example-caption {
        font-size: 0.8rem;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .product-actions .btn {
        width: 100%;
    }
    
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 100px 15px 40px;
        min-height: 220px;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .page-header p {
        font-size: 0.9rem;
    }
    
    .product-advantages h2 {
        font-size: 1.8rem;
    }
    
    .advantages-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-content {
        padding: 15px 15px 10px 15px;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-image i {
        font-size: 2.5rem;
    }
    
    .product-header h3 {
        font-size: 1.1rem;
    }
    
    .product-specs h4 {
        font-size: 1rem;
    }
    
    .specs-detail {
        padding: 10px;
    }
    
    .product-examples h4 {
        font-size: 0.95rem;
    }
    
    .product-examples p {
        font-size: 0.8rem;
        padding: 8px;
    }
    
    .example-img-single {
        max-width: 150px;
        height: 80px;
    }
    
    .example-caption {
        font-size: 0.75rem;
    }
    
    .category-tabs {
        padding: 0 5px;
    }
    
    .tab-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.loading-state i {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #d8b43d;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 50px;
    margin-bottom: 30px;
}

.page-btn {
    background: white;
    border: 2px solid #d8b43d;
    color: #d8b43d;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-btn:hover:not(:disabled) {
    background: #d8b43d;
    color: white;
    transform: translateY(-2px);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 8px;
}

.page-number {
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    background: white;
    color: #666;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.page-number:hover {
    border-color: #d8b43d;
    color: #d8b43d;
}

.page-number.active {
    background: #d8b43d;
    border-color: #d8b43d;
    color: white;
}

/* 无结果状态 */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #ddd;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #999;
}

.no-results p {
    font-size: 1rem;
    line-height: 1.6;
}

/* 产品卡片动画 */
.product-card {
    animation: fadeInUp 0.6s ease;
}

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

/* 加工实例样式 */
.product-examples {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

/* 内联加工实例样式 */
.product-examples-inline {
    margin: 10px 0 15px 0;
    text-align: left;
}

.view-examples-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.view-examples-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.4);
}

.view-examples-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.view-examples-btn i {
    font-size: 1rem;
}

/* 内联加工实例按钮样式 */
.view-examples-btn-inline {
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.3);
}

.view-examples-btn-inline:hover {
    background: linear-gradient(135deg, #219a52, #1e8449);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(39, 174, 96, 0.4);
}

.view-examples-btn-inline:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.3);
}

.view-examples-btn-inline i {
    font-size: 0.8rem;
}

/* 图片模态框样式 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.image-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: slideIn 0.3s ease;
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: background 0.2s ease;
}

.image-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.image-modal-title {
    padding: 20px 20px 10px;
    margin: 0;
    font-size: 1.2rem;
    color: #333;
    border-bottom: 1px solid #eee;
}

.image-modal-body {
    padding: 20px;
    text-align: center;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    height: auto;
    border-radius: 8px;
}

@keyframes slideIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .view-examples-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        border-radius: 20px;
    }

    .view-examples-btn i {
        font-size: 0.9rem;
    }

    .view-examples-btn-inline {
        padding: 5px 10px;
        font-size: 0.75rem;
        border-radius: 12px;
    }

    .view-examples-btn-inline i {
        font-size: 0.75rem;
    }

    .image-modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .image-modal-title {
        font-size: 1.1rem;
        padding: 15px 15px 8px;
    }

    .image-modal-body {
        padding: 15px;
    }

    .modal-image {
        max-height: 60vh;
    }
}