/* 产品中心页面样式 */

/* 全局变量 */
:root {
    --primary-color: #378CFF;
    --secondary-color: #FF963D;
    --dark-bg: #040C1A;
    --text-dark: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border-color: #EEEEEE;
    --bg-light: #F4F4F4;
    --bg-blue: #F6FBFF;
    --white: #FFFFFF;
}

/* 产品中心横幅 - 参考知识产权专利样式 */
.products-hero {
    width: 100%;
    position: relative;
    height: 488px;
    overflow: hidden;
    margin-top: 96px;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.products-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(3, 22, 36, 0.8) 0%, rgba(3, 22, 36, 0.24) 66%);
    z-index: 1;
}

.products-hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
}

.products-hero-content h1 {
    font-size: 48px;
    font-weight: 700;
    color: var(--white);
    margin: 0;
    font-family: 'Source Han Sans CN', sans-serif;
}

/* 产品内容区域 */
.products-content {
    padding: 80px 0;
    background: var(--white);
}

.section-title {
    font-size: 30px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 75px;
    color: var(--text-dark);
    font-family: 'Source Han Sans CN', sans-serif;
}

/* 产品分类标签 - 参考首页热销产品样式 */
.product-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 80px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    padding: 18px 40px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-family: 'Source Han Sans CN', sans-serif;
}

.tab-btn.active {
    color: var(--text-dark);
    font-size: 24px;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-btn:hover {
    color: var(--text-dark);
}

/* 产品网格 - 参考首页热销产品样式 */
.products-grid {
    margin-bottom: 80px;
    display: flex;
    justify-content: center;
}

.product-category {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
    width: 1196px;
    max-width: 100%;
}

.product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* 悬浮提示气泡 */
.product-card {
    position: relative;
}

.product-tooltip {
    font-family: "思源黑体";
    position: fixed;
    /* 与卡片同层级的悬浮层，基于视口定位 */
    width: 362px;
    max-width: 362px;
    max-height: 300px;
    /* 超出部分隐藏省略号显示 */
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    border-radius: 6px;
    padding: 12px 14px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    pointer-events: none;
    /* 不阻挡交互 */
    display: none;
    /* 由 JS 控制显示 */
}

.product-tooltip .tooltip-title {

    font-size: 20px;
    font-weight: bold;
    line-height: normal;
    text-align: justify;
    color: #FFFFFF;
}

.product-tooltip .tooltip-title-desc {
    font-size: 20px;
    font-weight: bold;
    color: #FFFFFF;
    margin-bottom: 16px;
}

.product-tooltip .tooltip-desc {
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4em;            /* 行高 */
    display: -webkit-box;          /* 多行省略所需 */
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 8;         /* 显示的最大行数，可按需调整 */
    overflow: hidden;              /* 隐藏超出 */
    text-overflow: ellipsis;       /* 省略号 */
    max-height: calc(1.4em * 8);   /* 与行高和行数对应 */
    overflow-wrap: anywhere;       /* 长词换行 */
    word-break: break-word;        /* 防止长连续字符撑破 */
}

/* 左右方向箭头 */
/* .product-tooltip.left::after,
.product-tooltip.right::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px;
    border-style: solid;
}
.product-tooltip.left::after {
    right: -16px;
    border-color: transparent transparent transparent rgba(0, 0, 0, 0.85);
}
.product-tooltip.right::after {
    left: -16px;
    border-color: transparent rgba(0, 0, 0, 0.85) transparent transparent;
} */

/* 悬浮显示由 JS 控制，这里不再通过 :hover 改变可见性 */
.product-card:hover .product-tooltip {}

.product-image {
    width: 220px;
    height: 220px;
    background: var(--white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
    /* 让提示层在图片容器内定位 */
}

/* 悬浮的时候 */
.product-card:hover .product-image {
    background: linear-gradient(28deg, #0B0C0E 16%, #232426 43%, #2A2C30 45%, #2F3541 79%, #5B6374 91%);
    box-shadow: 0px 4px 8px 0px rgba(7, 26, 51, 0.3);
}


.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


.product-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin: 0;
    font-family: 'Source Han Sans CN', sans-serif;
    line-height: 1.4;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 分页器样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.pagination-info {
    font-size: 14px;
    color: #606266;
    font-family: 'Source Han Sans CN', sans-serif;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-controls .page-numbers {
    display: flex;
    gap: 20px;
    align-items: center;
}

.page-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: #606266;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Source Han Sans CN', sans-serif;
}

.page-btn:hover:not(:disabled) {
    color: var(--primary-color);
    background: rgba(55, 140, 255, 0.1);
}

.page-btn.active {
    color: var(--primary-color);
    background: rgba(55, 140, 255, 0.1);
}

.page-btn:disabled {
    color: #C0C4CC;
    cursor: not-allowed;
}

.page-ellipsis {
    color: #606266;
    font-size: 14px;
    padding: 0 4px;
}

.prev-btn svg,
.next-btn svg {
    width: 12px;
    height: 12px;
}

/* 页脚样式 */
.footer {
    background: #EFF3F6;
}

.footer-main {
    padding: 20px 0;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 20px;
}

.footer-logo-img {
    width: 115px;
    height: 100px;
}

.footer-company-info h3 {
    font-size: 32px;
    font-weight: 700;
    color: #444343;
    margin: 0 0 12px 0;
    font-family: "Source Han Sans CN", sans-serif;
}

.footer-company-info p {
    font-size: 16px;
    color: #666666;
    margin: 0;
    font-family: "Source Han Sans CN", sans-serif;
}

.footer-nav {
    display: flex;
    gap: 40px;
}

.footer-nav a {
    font-size: 16px;
    color: #999999;
    text-decoration: none;
    font-family: "Source Han Sans CN", sans-serif;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    background: var(--dark-bg);
    padding: 13px 0;
    text-align: center;
}

.footer-bottom p {
    color: white;
    font-size: 16px;
    margin: 0;
    font-family: "Source Han Sans CN", sans-serif;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        padding: 0 40px;
    }

    .product-category {
        grid-template-columns: repeat(4, 1fr);
        width: 100%;
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .product-category {
        grid-template-columns: repeat(3, 1fr);
        max-width: 720px;
    }

    .product-image {
        width: 180px;
        height: 180px;
    }
}

@media (max-width: 768px) {
    .products-hero-content h1 {
        font-size: 36px;
    }

    .section-title {
        font-size: 24px;
        margin-bottom: 50px;
    }

    .product-tabs {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 60px;
    }

    .tab-btn {
        padding: 12px 20px;
        font-size: 16px;
    }

    .tab-btn.active {
        font-size: 18px;
    }

    .product-category {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        max-width: 480px;
    }

    .product-image {
        width: 160px;
        height: 160px;
    }

    .product-name {
        font-size: 14px;
    }

    .footer-logo {
        flex-direction: column;
        text-align: center;
    }

    .footer-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .footer-company-info h3 {
        font-size: 24px;
    }

    .pagination {
        flex-direction: row;
        gap: 15px;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }

    .products-content {
        padding: 60px 0;
    }

    .product-category {
        grid-template-columns: 1fr;
        max-width: 300px;
    }

    .product-image {
        width: 200px;
        height: 200px;
    }

    .footer-bottom p {
        font-size: 14px;
        line-height: 1.4;
    }
}

/* 加载动画 */
.product-card.loading {
    opacity: 0.6;
}

.product-card.loading .product-image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* 产品详情弹窗样式 */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.product-modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    z-index: 1001;
}

.modal-close:hover {
    color: #333;
}