/* style.css - 深圳市冠盛精密机械有限公司网站样式 */

:root {
    --primary-color: #1a3a6c;
    --secondary-color: #c62828;
    --accent-color: #ff9800;
    --light-color: #f5f7fa;
    --dark-color: #333;
    --gray-color: #777;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f9f9f9;
    padding-top: 90px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== 头部样式 ==================== */
header {
    background-color: white;
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    padding: 0 20px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 55px;
    min-width: 60px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-img img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    width: auto;
    height: 55px;
    max-width: 200px;
}

.logo-text h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-text p {
    font-size: 12px;
    color: var(--gray-color);
}

.nav-container {
    display: flex;
    align-items: center;
    flex-grow: 1;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    transition: all 0.3s ease;
}

.nav-menu li {
    margin: 0 15px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
    display: block;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    font-size: 24px;
    color: var(--primary-color);
    cursor: pointer;
    background: none;
    border: none;
    margin-left: auto;
    z-index: 1001;
}

/* ==================== 轮播图样式 ==================== */
.swiper-container {
    width: 100%;
    height: 500px;
    margin: 20px 0 40px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
}

.swiper-slide {
    position: relative;
    overflow: hidden;
}

.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
    transform: translateZ(0);
    will-change: transform;
}

.swiper-slide-active .slide-bg {
    transform: scale(1.05);
}

.swiper-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 58, 108, 0.7) 0%, rgba(0, 0, 0, 0.5) 100%);
    z-index: 1;
}

.swiper-slide-content {
    position: absolute;
    bottom: 80px;
    left: 80px;
    color: white;
    z-index: 2;
    max-width: 600px;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.swiper-slide-content h2 {
    font-size: 42px;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.swiper-slide-content p {
    font-size: 18px;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    opacity: 0.95;
}

.swiper-button-next,
.swiper-button-prev {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background-color: var(--primary-color);
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 24px;
}

.swiper-pagination-bullet {
    background-color: rgba(255, 255, 255, 0.5);
}

.swiper-pagination-bullet-active {
    background-color: var(--accent-color);
}

/* ==================== 内容区块样式 ==================== */
.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 32px;
    color: var(--primary-color);
    display: inline-block;
    padding-bottom: 10px;
    position: relative;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--secondary-color);
}

.section-subtitle {
    text-align: center;
    color: var(--gray-color);
    margin-bottom: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-size: 18px;
}

.section-content {
    margin-bottom: 60px;
}

/* ==================== 首页特色区域 ==================== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.feature-card {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

/* ==================== 首页主要产品网格 ==================== */
.home-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.home-product-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.home-product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.12);
}

.home-product-img {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    background: #ffffff;
}

.home-product-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: transform 0.3s ease;
}

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

/* ==================== 工厂环境卡片 ==================== */
.environment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.environment-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.environment-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.environment-img {
    height: 220px;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

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

.environment-info {
    padding: 20px;
}

.environment-info h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.environment-info h3 i {
    color: var(--accent-color);
    font-size: 18px;
}

.environment-info p {
    color: var(--gray-color);
    line-height: 1.6;
    font-size: 14px;
}

.environment-stats {
    display: flex;
    justify-content: space-around;
    background: var(--light-color);
    border-radius: 12px;
    padding: 40px 20px;
    margin: 50px 0 30px;
    text-align: center;
}

.stat-item {
    flex: 1;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    color: var(--gray-color);
    font-size: 14px;
    margin-top: 8px;
}

/* ==================== 产品展示页面 ==================== */
.product-showcase {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px 60px;
}

.product-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 30px;
}

.product-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.12);
    border-color: rgba(26, 58, 108, 0.15);
}

.product-img-frame {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img-frame img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 24px;
    transition: transform 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}

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

.empty-tip {
    text-align: center;
    padding: 80px 20px;
    color: #999;
    font-size: 18px;
}

/* ==================== 生产设备页面（流畅版 - 模仿工厂环境） ==================== */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.equipment-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.equipment-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.equipment-img {
    height: 220px;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

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

.equipment-info {
    padding: 20px;
}

.equipment-info h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.equipment-card:hover .equipment-info h3 {
    color: #0f2a4f;
}

.equipment-info p {
    color: var(--gray-color);
    line-height: 1.6;
    font-size: 14px;
}

/* ==================== 关于我们页面 ==================== */
.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
    margin-bottom: 60px;
}

.about-image {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.about-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.about-image:hover img {
    transform: scale(1.02);
}

.about-text {
    flex: 1;
}

.about-text h3 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.principles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.principle-item {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.principle-item:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-5px);
}

.principle-item:hover h4 {
    color: white;
}

.principle-item h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 20px;
    transition: color 0.3s ease;
}

/* ==================== 联系我们页面 ==================== */
.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.contact-card {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.contact-icon {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.contact-card h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.phone-list {
    margin-top: 15px;
}

.phone-item {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    padding: 8px 0;
}

.phone-item i {
    margin-right: 12px;
    color: var(--primary-color);
    width: 20px;
}

.phone-link {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 16px;
}

.phone-link:hover {
    color: var(--primary-color);
}

.map-container {
    height: 450px;
    background-color: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 50px;
    position: relative;
}

.map-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--gray-color);
    text-align: center;
}

.traffic-guide {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 50px;
}

.traffic-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.traffic-item h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    font-size: 18px;
}

.traffic-item i {
    margin-right: 10px;
    color: var(--accent-color);
}

/* ==================== 筛选按钮 ==================== */
.product-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 25px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
    color: var(--dark-color);
}

.filter-btn.active,
.filter-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ==================== 页脚样式 ==================== */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.footer-links h3,
.footer-contact h3 {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    position: relative;
}

.footer-links h3::after,
.footer-contact h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--secondary-color);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a,
.contact-link {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.footer-links a:hover,
.contact-link:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.contact-link i {
    margin-right: 10px;
    color: var(--accent-color);
    width: 20px;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

/* ==================== 备案号链接样式 ==================== */
.copyright a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s ease;
}

.copyright a:hover {
    color: #ff9800;
    text-decoration: underline;
}

/* ==================== 懒加载图片样式 ==================== */
.lazy-img {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lazy-img.loaded {
    opacity: 1;
}

.environment-img .lazy-img,
.product-img .lazy-img,
.equipment-img .lazy-img {
    background-color: #f0f0f0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    image-rendering: auto;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 992px) {
    .about-content {
        flex-direction: column;
    }

    .swiper-container {
        height: 400px;
    }

    .swiper-slide-content {
        left: 40px;
        bottom: 40px;
    }

    .swiper-slide-content h2 {
        font-size: 32px;
    }

    .environment-grid,
    .equipment-grid,
    .features,
    .contact-info {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .environment-stats {
        flex-wrap: wrap;
        gap: 30px;
    }

    .stat-item {
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 80px;
    }

    .logo-img img {
        height: 46px;
        max-width: 150px;
    }

    .logo-text h1 {
        font-size: 20px;
    }

    .logo-text p {
        font-size: 11px;
    }

    .nav-container {
        order: 3;
        width: 100%;
        margin-top: 15px;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        background: white;
        padding: 20px;
        border-radius: 8px;
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 1000;
        box-shadow: var(--shadow);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        margin: 0 0 10px 0;
    }

    .nav-menu a {
        padding: 10px;
        border-bottom: 1px solid #eee;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .swiper-container {
        height: 350px;
    }

    .swiper-slide-content {
        left: 30px;
        bottom: 30px;
    }

    .swiper-slide-content h2 {
        font-size: 26px;
    }

    .swiper-slide-content p {
        font-size: 14px;
    }

    .section-title h2 {
        font-size: 28px;
    }

    .product-filter {
        gap: 10px;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 10px;
    }

    .filter-btn {
        padding: 8px 20px;
        font-size: 14px;
        flex-shrink: 0;
    }

    .map-container {
        height: 350px;
    }

    .environment-stats {
        flex-direction: column;
        gap: 20px;
    }

    .stat-number {
        font-size: 28px;
    }

    .equipment-img {
        height: 200px;
    }

    .equipment-grid {
        gap: 20px;
    }
}

@media (max-width: 576px) {
    body {
        padding-top: 130px;
    }

    .principles {
        grid-template-columns: 1fr;
    }

    .swiper-container {
        height: 280px;
    }

    .swiper-slide-content h2 {
        font-size: 22px;
    }

    .swiper-slide-content p {
        font-size: 12px;
    }

    .features,
    .equipment-grid,
    .contact-info,
    .environment-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .equipment-img {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .logo-img img {
        height: 41px;
        max-width: 120px;
    }

    .swiper-container {
        height: 250px;
    }

    .swiper-slide-content {
        left: 20px;
        bottom: 20px;
    }

    .swiper-slide-content h2 {
        font-size: 20px;
    }

    .swiper-slide-content p {
        font-size: 11px;
    }

    .section-title h2 {
        font-size: 24px;
    }

    .map-container {
        height: 300px;
    }
}