/**
 * 河北乾鑫塑料制品有限公司官网样式
 * 响应式设计，支持 PC 端和移动端
 */

/* ========== 重置和基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0066cc;
    --secondary-color: #0052a3;
    --accent-color: #ff6600;
    --text-color: #333;
    --text-light: #666;
    --text-lighter: #999;
    --bg-color: #fff;
    --bg-gray: #f5f5f5;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 图片加载失败时的样式 */
img.lazy-img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img.lazy-img[src=""],
img.lazy-img:not([src]) {
    opacity: 0;
    background: #f0f0f0;
}

/* 占位图样式 */
.product-image img,
.news-image img,
.case-image img {
    background: #f5f5f5;
    min-height: 200px;
}

ul {
    list-style: none;
}

/* ========== 按钮样式 ========== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* ========== 头部导航 ========== */
.header {
    background-color: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.logo img {
    height: 50px;
    width: auto;
}

.logo-text {
    font-size: 1.2rem;
}

.nav-list {
    display: flex;
    gap: 30px;
}

.nav-list a {
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

.nav-list a:hover,
.nav-list a.active {
    color: var(--primary-color);
}

.nav-list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-list a:hover::after,
.nav-list a.active::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: var(--transition);
}

/* ========== Banner ========== */
.banner {
    background: #fff;
    color: #fff;
    padding: 0;
    text-align: center;
    overflow: hidden;
}

.banner-slider {
    width: 100%;
    height: 600px;
    position: relative;
}

.banner-item {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.banner-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.banner-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: bold;
}

.banner-content p {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.banner-subtitle {
    font-size: 1.2rem !important;
    opacity: 0.9;
    margin-bottom: 30px !important;
}

.banner-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 30px 0;
}

.banner-features span {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* ========== Section 通用样式 ========== */
.section {
    padding: 80px 0;
}

.section-gray {
    background-color: var(--bg-gray);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-top: 20px;
}

.section-footer {
    text-align: center;
    margin-top: 50px;
}

/* ========== 产品分类 ========== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.category-card {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon img {
    max-width: 100%;
    max-height: 100%;
}

.category-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.category-card p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.category-link {
    color: var(--primary-color);
    font-weight: 500;
}

.category-link:hover {
    gap: 5px;
}

/* ========== 产品卡片 ========== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.product-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background-color: var(--bg-gray);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.product-info h3 a:hover {
    color: var(--primary-color);
}

.product-category {
    color: var(--text-lighter);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.product-desc {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.product-link {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
}

/* ========== 公司优势 ========== */
.advantages-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 30px;
}

.advantage-item {
    text-align: center;
    padding: 20px;
}

.advantage-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.advantage-item h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.advantage-item p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ========== 工程案例 ========== */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.case-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.case-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.case-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
    background-color: var(--bg-gray);
}

.case-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.case-card:hover .case-image img {
    transform: scale(1.1);
}

.case-info {
    padding: 25px;
}

.case-info h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.case-meta {
    display: flex;
    gap: 15px;
    color: var(--text-lighter);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.case-products {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ========== 新闻资讯 ========== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.news-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.news-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: var(--bg-gray);
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.news-card:hover .news-image img {
    transform: scale(1.1);
}

.news-content {
    padding: 20px;
}

.news-content h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-content h3 a:hover {
    color: var(--primary-color);
}

.news-meta {
    display: flex;
    gap: 15px;
    color: var(--text-lighter);
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.news-excerpt {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.6;
}

.news-link {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
}

/* ========== CTA 区块 ========== */
.cta {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    text-align: center;
    padding: 60px 0;
}

.cta-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.cta-contact {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.cta-phone {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
}

.cta-phone:hover {
    opacity: 0.9;
}

/* ========== 页脚 ========== */
.footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 40px;
}

.footer-about h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.footer-about p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.footer-links ul,
.footer-contact ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a,
.footer-contact li {
    color: rgba(255, 255, 255, 0.8);
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.footer-bottom p {
    margin-bottom: 10px;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: var(--transition);
}

.pagination a:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.pagination .current {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.pagination .prev,
.pagination .next {
    font-weight: 500;
}

/* ========== 表单样式 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
    .categories-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .advantages-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .header-wrapper {
        padding: 10px 0;
    }
    
    .nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: #fff;
        box-shadow: var(--shadow);
        transform: translateY(-150%);
        transition: var(--transition);
        z-index: 999;
    }
    
    .nav.active {
        transform: translateY(0);
    }
    
    .nav-list {
        flex-direction: column;
        padding: 20px;
        gap: 0;
    }
    
    .nav-list li {
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-list a {
        display: block;
        padding: 15px 0;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .banner {
        padding: 0;
    }
    
    .banner-slider {
        height: 400px;
    }
    
    .banner-content h1 {
        font-size: 2rem;
    }
    
    .banner-content p {
        font-size: 1.1rem;
    }
    
    .banner-features {
        gap: 10px;
    }
    
    .banner-features span {
        padding: 6px 15px;
        font-size: 0.8rem;
    }
    
    .section {
        padding: 50px 0;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .categories-grid,
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cases-grid {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-content h2 {
        font-size: 1.5rem;
    }
    
    .cta-contact {
        flex-direction: column;
        gap: 20px;
    }
    
    .cta-phone {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .advantages-grid {
        grid-template-columns: 1fr;
    }
    
    .banner-features {
        flex-direction: column;
        align-items: center;
    }
}

/* ========== 动画效果 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ========== 加载状态 ========== */
.loading {
    text-align: center;
    padding: 50px;
    color: var(--text-light);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== 工具类 ========== */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}
