/* ===================================
   恒仰五金官网 - 样式表
   版本: 1.0
   日期: 2026-04-16
=================================== */

/* CSS变量定义 */
:root {
    --primary-color: #005499;
    --primary-dark: #004075;
    --primary-light: #0073c6;
    --secondary-color: #2c3e50;
    --accent-color: #e67e22;
    --accent-hover: #d35400;
    --text-color: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --bg-color: #f8f9fa;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --radius: 8px;
    --radius-sm: 4px;
}

/* 重置样式 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

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

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

/* ===================================
   按钮样式
=================================== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

.btn-accent {
    background-color: var(--accent-color);
    color: var(--white);
    border-color: var(--accent-color);
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-block {
    display: block;
    width: 100%;
}

/* ===================================
   头部导航
=================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
}

.navbar {
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-menu a {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    padding: 8px 0;
    position: relative;
}

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

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

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

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: var(--transition);
}

/* ===================================
   Banner轮播
=================================== */
.banner {
    position: relative;
    margin-top: 80px;
    height: 450px;
    overflow: hidden;
}

.banner-slides {
    height: 100%;
    position: relative;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    display: flex;
    align-items: center;
}

.banner-slide.active {
    opacity: 1;
    visibility: visible;
}

.banner-content {
    color: var(--white);
    max-width: 600px;
}
.banner-content h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
.banner-content p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Banner背景图 */
.banner-slide:first-child {
    background: url('../images/ban-01.gif') center/cover no-repeat, linear-gradient(135deg, #005499 0%, #0073c6 100%);
}
.banner-slide:nth-child(2) {
    background: url('../images/banner.jpg') center/cover no-repeat, linear-gradient(135deg, #2c3e50 0%, #4a6572 100%);
}
.banner-slide:nth-child(3) {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
}

.banner-prev,
.banner-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.banner-prev {
    left: 20px;
}

.banner-next {
    right: 20px;
}

.banner-prev:hover,
.banner-next:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.banner-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.banner-dots .dot.active {
    background-color: var(--white);
}

/* ===================================
   区块标题
=================================== */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
}

.section-header p {
    font-size: 16px;
    color: var(--text-light);
}

.section-header.light h2,
.section-header.light p {
    color: var(--white);
}

.section-header .more-link {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 500;
    margin-top: 10px;
}

.section-header .more-link:hover {
    color: var(--primary-dark);
}

/* ===================================
   企业优势
=================================== */
.features {
    padding: 80px 0;
    background-color: var(--bg-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.feature-card {
    background-color: var(--white);
    padding: 40px 30px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon i {
    font-size: 36px;
    color: var(--white);
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
}

.feature-card p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.8;
}

/* ===================================
   产品分类
=================================== */
.categories {
    padding: 80px 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.category-card {
    background-color: var(--white);
    padding: 30px 20px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.category-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.category-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    background-color: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon i {
    font-size: 30px;
    color: var(--primary-color);
}

.category-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.category-card p {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.6;
}

/* ===================================
   产品展示
=================================== */
.products {
    padding: 80px 0;
    background-color: var(--bg-color);
}

.products.new-products {
    background-color: var(--white);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.product-card {
    background-color: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-card-link {
    display: block;
    color: inherit;
}

.product-card-link:hover {
    color: inherit;
}

.product-card-link .product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    position: relative;
    height: 160px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.product-image img {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: var(--transition);
}

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

.product-image .placeholder {
    color: var(--text-lighter);
    text-align: center;
}

.product-image .placeholder i {
    font-size: 48px;
    margin-bottom: 10px;
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    background-color: var(--accent-color);
    color: var(--white);
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-info .product-no {
    font-size: 12px;
    color: var(--text-lighter);
    margin-bottom: 10px;
}

.product-info .product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.product-info .btn {
    width: 100%;
    padding: 10px;
    font-size: 13px;
}

/* ===================================
   关于我们摘要
=================================== */
.about-preview {
    padding: 80px 0;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-color);
}

.about-text p {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    gap: 40px;
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.stat {
    text-align: center;
}

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

.stat-label {
    font-size: 13px;
    color: var(--text-light);
}

.about-image {
    display: flex;
    justify-content: center;
}

.image-placeholder {
    width: 100%;
    max-width: 400px;
    height: 300px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.image-placeholder i {
    font-size: 72px;
    margin-bottom: 15px;
    opacity: 0.8;
}

.image-placeholder p {
    font-size: 16px;
    opacity: 0.9;
}

/* ===================================
   库存特卖
=================================== */
.sale-section {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.sale-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.sale-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 10px;
}

.sale-info p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.sale-counter {
    text-align: right;
}

.sale-counter p {
    font-size: 18px;
    color: var(--accent-color);
    font-weight: 600;
}

/* ===================================
   底部信息
=================================== */
.footer {
    background-color: var(--secondary-color);
    color: rgba(255, 255, 255, 0.8);
    padding: 60px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 20px;
    position: relative;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-col p {
    font-size: 14px;
    line-height: 2;
    margin-bottom: 10px;
}

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

.footer-col ul li a {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.footer-col ul li a:hover {
    color: var(--white);
    padding-left: 5px;
}

.footer-col i {
    width: 20px;
    color: var(--primary-light);
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--white);
}

.footer-social a:hover {
    background-color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 5px;
}

/* ===================================
   弹窗样式
=================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--text-color);
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 84, 153, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ===================================
   响应式设计
=================================== */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: var(--white);
        flex-direction: column;
        padding: 20px;
        gap: 0;
        box-shadow: var(--shadow);
        transform: translateY(-150%);
        transition: var(--transition);
    }

    .nav-menu.active {
        transform: translateY(0);
    }

    .nav-menu li {
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        display: block;
        padding: 15px 0;
    }

    .banner {
        height: 350px;
        margin-top: 70px;
    }

    .banner-content h1 {
        font-size: 28px;
    }

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

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

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-image {
        order: -1;
    }

    .sale-banner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .sale-counter {
        text-align: center;
    }

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

    .about-stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

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

    .banner {
        height: 280px;
    }

    .banner-content h1 {
        font-size: 22px;
    }

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

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

    .modal-content {
        padding: 25px;
    }

    .banner-prev,
    .banner-next {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

/* ===================================
   动画效果
=================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* ===================================
   打印样式
=================================== */
@media print {
    .header,
    .banner,
    .features,
    .categories,
    .products,
    .footer,
    .modal {
        display: none;
    }
}