/* 全局样式与变量定义 */

:root {
    --primary-color: #32228b;
    --primary-dark: #120064;
    --secondary-color: #4a3abf;
    --light-color: #f8f9fa;
    --gray-color: #666;
    --dark-gray: #333;
    --success-color: #32228b;
    --success-light: rgba(34, 139, 34, 0.1);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
}

body {
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: var(--light-color);
}

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

a:hover {
    color: var(--primary-dark);
}

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

.section-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 10px auto 0;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--gray-color);
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-link {
    color: var(--primary-color);
    text-decoration: underline;
    padding: 0;
    background-color: transparent;
    font-weight: normal;
}

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

.center-button {
    text-align: center;
    margin-top: 50px;
}


/* 导航栏样式 */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 10px 50px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    margin-right: 10px;
    transition: var(--transition);
}

.logo img:hover {
    transform: scale(1.05);
}

.logo span {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav ul li {
    margin: 0 15px;
    position: relative;
}

.main-nav ul li a {
    color: var(--dark-gray);
    padding: 5px 0;
    font-size: 1.1rem;
    position: relative;
    display: block;
}

.main-nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.main-nav ul li a:hover::after,
.main-nav ul li a.active::after {
    width: 100%;
}

.main-nav ul li a.active {
    color: var(--primary-color);
    font-weight: 500;
}


/* 下拉菜单样式 */

.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-radius: 4px;
    padding: 8px 0;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s ease;
}

.dropdown:hover .dropdown-menu {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: var(--dark-gray);
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.dropdown-menu a:hover {
    background-color: #f5f5f5;
    color: var(--primary-color);
}


/* 移动端菜单 */

.navbar {
    display: none;
    /* 桌面端导航默认隐藏，移动端不显示 */
}


/* 顶部固定导航（移动端） */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    /* 确保在内容上方 */
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.logo span {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}


/* 菜单按钮样式 */

.menu-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
    z-index: 1000;
}


/* 侧边栏导航 */

.sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    /* 默认隐藏在右侧 */
    width: 280px;
    height: 100vh;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease;
    z-index: 1001;
    /* 高于遮罩层和导航栏 */
    padding-top: 70px;
    /* 预留顶部导航高度 */
}

.sidebar.active {
    right: 0;
    /* 显示侧边栏 */
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
}

.nav-list {
    padding: 0 20px;
}

.nav-list li {
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.nav-list a {
    color: #333;
    font-size: 1rem;
    display: block;
    padding: 5px 0;
}

.nav-list a.active {
    color: #32228b;
    font-weight: bold;
}


/* 移动端子菜单样式 */

.nav-list .dropdown-menu {
    margin-left: 20px;
    margin-top: 10px;
    position: static;
    box-shadow: none;
    min-width: auto;
    padding: 0;
}


/* 遮罩层 */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
    /* 高于内容，低于侧边栏 */
}

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


/* 英雄区域 */

.hero {
    height: 80vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    color: white;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.hero-buttons {
    display: flex;
    gap: 20px;
}


/* 产品展示（全设备适配优化） */

.products {
    padding: 100px 20px;
    /* 增加左右内边距，避免小屏幕内容贴边 */
    background-color: #f8f9fa;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    /* 自动填充列，最小宽度300px */
    gap: 30px;
    /* 统一间距 */
}

.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    /* 确保内容按列排列 */
    height: 100%;
    /* 卡片高度自适应内容 */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.product-card img {
    width: 100%;
    height: 200px;
    /* 固定图片高度，保持统一视觉效果 */
    object-fit: cover;
    /* 图片裁剪适配，避免拉伸变形 */
    transition: transform 0.3s ease;
    /* 增加图片缩放过渡 */
}

.product-card:hover img {
    transform: scale(1.03);
    /* 悬停时图片轻微放大 */
}

.card-content {
    padding: 25px;
    flex-grow: 1;
    /* 内容区域自动填充剩余空间 */
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #32228b;
}

.card-content p {
    color: #666;
    margin-bottom: 20px;
    flex-grow: 1;
    /* 段落自动填充空间，按钮始终在底部 */
    line-height: 1.7;
    /* 优化行高，提升可读性 */
}

.card-content .btn-link {
    margin-top: auto;
    /* 确保按钮在内容底部 */
    display: inline-block;
    /* 确保链接可点击区域正确 */
}


/* 平板设备适配（768px - 1023px） */

@media (max-width: 1023px) {
    .products {
        padding: 80px 15px;
        /* 减少上下内边距 */
    }
    .products-grid {
        gap: 25px;
        /* 缩小间距 */
    }
    .card-content {
        padding: 20px;
    }
    .card-content h3 {
        font-size: 1.3rem;
    }
    .product-card img {
        height: 180px;
        /* 适当降低图片高度 */
    }
}


/* 手机设备适配（≤767px） */

@media (max-width: 767px) {
    .products {
        padding: 60px 10px;
        /* 进一步减少内边距 */
    }
    .products-grid {
        grid-template-columns: 1fr;
        /* 手机屏幕显示单列 */
        gap: 20px;
    }
    .section-title {
        font-size: 2rem;
        /* 缩小标题字体 */
    }
    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 40px;
        padding: 0 5px;
        /* 增加左右内边距，避免文字贴边 */
    }
    .product-card img {
        height: 160px;
        /* 手机端图片高度进一步降低 */
    }
    .card-content {
        padding: 20px 15px;
    }
    .card-content p {
        font-size: 0.95rem;
        /* 缩小文字，提升可读性 */
    }
}


/* 小屏手机适配（≤375px） */

@media (max-width: 375px) {
    .card-content h3 {
        font-size: 1.2rem;
    }
    .product-card img {
        height: 140px;
        /* 最小屏幕图片高度 */
    }
}


/* 联系我们 */

.contact {
    padding: 100px 0;
    background-color: white;
}

.contact-content {
    display: flex;
    gap: 60px;
}

.contact-info {
    flex-basis: 40%;
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
}

.info-icon {
    width: 50px;
    height: 50px;
    background-color: rgba(34, 139, 34, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    color: #32228b;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.info-text h3 {
    font-size: 1.2rem;
    color: #32228b;
    margin-bottom: 5px;
}

.info-text p {
    color: #666;
}

.contact-form {
    flex-basis: 60%;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #32228b;
}

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


/* 页脚 */

.footer {
    background-color: #333;
    color: white;
    padding: 80px 0 30px;
}

.footer-top {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 60px;
}

.footer-logo img {
    height: 40px;
    margin-bottom: 20px;
}

.footer-logo p {
    color: #ccc;
}

.footer-links h3,
.footer-products h3,
.footer-contact h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: white;
}

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

.footer-links ul li,
.footer-products ul li,
.footer-contact ul li {
    margin-bottom: 10px;
}

.footer-links ul li a,
.footer-products ul li a {
    color: #ccc;
    transition: color 0.3s ease;
}

.footer-links ul li a:hover,
.footer-products ul li a:hover {
    color: #32228b;
}

.footer-contact ul li {
    display: flex;
    align-items: center;
}

.footer-contact ul li i {
    margin-right: 10px;
    color: #32228b;
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom p {
    color: #ccc;
}

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

.social-icon {
    width: 35px;
    height: 35px;
    background-color: #444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: #32228b;
}


/* 响应式设计 */

@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 30px;
    }
    .navbar {
        padding: 15px 30px;
    }
    .navbar.scrolled {
        padding: 10px 30px;
    }
    .main-nav {
        display: none;
    }
    .mobile-menu-button {
        display: block;
    }
    .mobile-menu {
        display: block;
    }
    .hero-content {
        max-width: 100%;
        text-align: center;
    }
    .hero-buttons {
        justify-content: center;
    }
    .advantages-grid,
    .products-grid,
    .cases-grid,
    .about-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .about {
        padding: 80px 0;
    }
    .about::after {
        display: none;
    }
    .about-content {
        max-width: 100%;
        margin-bottom: 40px;
    }
    .about-image {
        position: static;
        transform: none;
        width: 100%;
    }
    .contact-content {
        flex-direction: column;
    }
    .footer-top {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* 响应式调整：桌面端显示传统导航 */

@media (min-width: 768px) {
    .navbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        background-color: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 999;
    }
    .header {
        display: none;
        /* 桌面端隐藏移动端导航 */
    }
    .sidebar,
    .overlay {
        display: none;
        /* 桌面端隐藏侧边栏和遮罩层 */
    }
    .main-nav .nav-links {
        display: flex;
        gap: 25px;
    }
    .main-nav a {
        color: #333;
        font-size: 1rem;
    }
    .main-nav a.active {
        color: #32228b;
        font-weight: bold;
    }
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #fff;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
        min-width: 200px;
        display: none;
    }
    .dropdown {
        position: relative;
    }
    .dropdown:hover .dropdown-menu {
        display: block;
    }
    .main {
        margin-top: 70px;
        /* 适配桌面端导航高度 */
    }
}