﻿/* 基础设置 - 设置根元素字体大小方便rem单位计算 */
:root {
    font-size: 16px; /* 1rem = 16px */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    color: #444;
    text-decoration: none;
}

    a:hover {
        color: #3687d9;
        text-decoration: underline;
    }

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    min-width: 1200px;
}

/* 主要内容区域 */
.main-content {
    width: 1200px;
    margin: 1rem auto 0; /* 头部高度48px + 导航条高度50px + 间隙55px = 153px/16 = 9.5625rem */
    padding: 1rem 0;
    display: flex;
}

/* 左边内容区域 */
.content-left {
    width: 58.125rem; /* 930px */
    margin-right: 0.625rem; /* 10px */
}

/* 分类栏目 */
.category-section {
    margin-bottom: 1.25rem; /* 20px */
    border: 1px solid #e8e8e8;
    padding: 0.625rem; /* 10px */
}

.category-title {
    font-size: 1.125rem; /* 18px */
    font-weight: bold;
    color: #444;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 0.625rem; /* 10px */
}

    .category-title a {
        color: #444;
        text-decoration: none;
    }

        .category-title a:hover {
            color: #3687d9;
        }

.products-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.625rem; /* 10px */
}

.product-item {
    text-align: center;
    padding: 0.5rem;
    border: 1px solid #f0f0f0;
    width: calc((930px - 20px * 5) / 6); /* 精确计算每个产品的宽度 */
    max-width: 100%;
    box-sizing: border-box;
}

.product-image {
    width: 100%;
    height: 6.25rem; /* 100px */
    background-color: #f5f5f5;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .product-image img {
        max-width: 100%;
        max-height: 100%;
    }

.product-title {
    font-size: 0.875rem; /* 14px */
    color: #444;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
}

.product-company {
    font-size: 0.75rem; /* 12px */
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
}

/* 友情链接 */
.friend-links {
    border: 1px solid #e8e8e8;
    padding: 0.625rem;
    margin-bottom: 1.25rem;
    width: 1200px;
    margin: 0rem auto 0;
}

.friend-links-title {
    font-size: 1.125rem;
    font-weight: bold;
    color: #444;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 0.625rem;
}

.friend-links-list {
    display: flex;
    flex-wrap: wrap;
}

.friend-links-item {
    margin-right: 1rem;
    margin-bottom: 0.5rem;
}

    .friend-links-item a {
        color: #3687d9;
        text-decoration: none;
        font-size: 0.875rem;
    }

        .friend-links-item a:hover {
            text-decoration: underline;
        }

/* 右边内容区域 */
.content-right {
    width: 16.25rem; /* 260px */
}

.right-section {
    border: 1px solid #e8e8e8;
    margin-bottom: 0.625rem; /* 10px */
    padding: 0.625rem; /* 10px */
}

.right-section-title {
    font-size: 1rem; /* 16px */
    font-weight: bold;
    color: #3687d9;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 0.5rem;
}

    .right-section-title a {
        color: inherit;
        text-decoration: none;
    }

        .right-section-title a:hover {
            text-decoration: underline;
        }

.right-section-list {
    list-style: none;
}

.right-section-item {
    padding: 0.25rem 0;
    font-size: 0.875rem; /* 14px */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .right-section-item a {
        color: #444;
        text-decoration: none;
    }

        .right-section-item a:hover {
            color: #3687d9;
            text-decoration: underline;
        }



/* 响应式设计 */
@media (max-width: 1200px) {
    body {
        min-width: auto;
    }

    .header-inner, .nav-container, .main-content, .footer-container, .friend-links {
        width: 100%;
        padding: 0 0.9375rem; /* 15px */
    }

    .content-left {
        width: calc(100% - 16.875rem); /* 减去右边栏宽度+间隙 */
    }
}

@media (max-width: 992px) {
    .nav-menu {
        overflow-x: auto;
        white-space: nowrap;
    }

        .nav-menu::-webkit-scrollbar {
            display: none;
        }

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .product-item {
        width: auto;
    }
}

@media (max-width: 768px) {
    :root {
        font-size: 14px;
    }

    .header-outer {
        height: auto;
        padding: 0.5rem 0;
        position: relative;
    }

    .nav-bar {
        margin-top: 0;
    }

    .header-left, .header-right {
        width: 100%;
    }

    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 0.625rem;
    }

    .header-left {
        margin-bottom: 0.625rem;
        justify-content: center;
    }

        .header-left a {
            margin: 0 0.625rem 0.3125rem;
        }

    .header-right {
        justify-content: center;
    }

    .search-input {
        width: 12.5rem;
    }

    .nav-logo {
        display: none;
    }

    .nav-menu {
        width: 100%;
        justify-content: space-around;
        margin-left: 0;
    }

        .nav-menu a {
            padding: 0 0.5rem;
            font-size: 0.875rem;
        }

    .main-content {
        flex-direction: column;
        margin-top: 0;
    }

    .content-left, .content-right {
        width: 100%;
        margin-right: 0;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-links {
        justify-content: flex-start;
    }

    .footer-link {
        margin: 0 0.5rem 0.5rem;
    }

    .footer-qrcodes {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .search-form {
        width: 100%;
    }

    .search-input {
        width: 70%;
    }

    .search-button {
        width: 30%;
    }

    .header-left a span {
        display: none;
    }

    .header-left a i {
        margin-right: 0;
        font-size: 1rem;
    }

    .nav-menu a span {
        display: none;
    }

    .nav-menu a:before {
        content: attr(data-short);
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-info, .footer-cert {
        text-align: left;
    }
}
/* 金牌企业样式 */
.gold-enterprise {
    border: 1px solid #e8e8e8;
    padding: 0.625rem;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: bold;
    color: #333;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 0.625rem;
}

.enterprise-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.625rem;
}

.enterprise-item {
    text-align: center;
    padding: 0.5rem;
    border: 1px solid #f0f0f0;
}

.enterprise-image {
    width: 100%;
    height: 5rem; /* 80px */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

    .enterprise-image img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

.enterprise-name {
    font-size: 0.875rem;
    color: #333;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.5em;
    line-height: 1.25em;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .enterprise-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .enterprise-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .enterprise-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* 推荐企业样式 */
.recommended-enterprise {
    margin-bottom: 0.625rem;
}

.recommended-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.recommended-item {
    border-bottom: 1px dashed #e8e8e8;
    padding-bottom: 0.625rem;
}

    .recommended-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .recommended-item .enterprise-link {
        display: block;
        text-decoration: none;
        color: inherit;
    }

    .recommended-item .enterprise-image {
        width: 100%;
        height: 9rem; 
        overflow: hidden;
        margin-bottom: 0.5rem;
    }

        .recommended-item  .enterprise-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s;
        }

    .recommended-item .enterprise-link:hover .enterprise-image img {
        transform: scale(1.05);
    }

    .recommended-item .enterprise-info {
        padding: 0 0.25rem;
    }

    .recommended-item .enterprise-name {
        font-size: 1rem;
        font-weight: bold;
        color: #3687d9;
        margin-bottom: 0.25rem;
      /*  white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;*/
    }

    .recommended-item .enterprise-desc {
        font-size: 0.8125rem; /* 13px */
        color: #666;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        height: 4em; /* 3行 x 1.2行高 */
    }