/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 导航栏 */
header {
    background-color: transparent;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1;
    transition: all 0.3s ease;
}

/* 滚动后的导航栏样式 */
header.scrolled {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 初始状态 - 透明背景时的文字颜色 */
header:not(.scrolled) .logo,
header:not(.scrolled) .nav-links a,
header:not(.scrolled) .mobile-menu i {
    color: #fff;
}

/* 滚动状态 - 白色背景时的文字颜色 */
header.scrolled .logo,
header.scrolled .nav-links a,
header.scrolled .mobile-menu i {
    color: #333;
}

header:not(.scrolled) .dropdown-menu {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px); /* 添加毛玻璃效果 */
}

header:not(.scrolled) .dropdown-menu li a {
    color: #333; /* 深色文字确保可见 */
}

/* 滚动状态下保持原有样式 */
header.scrolled .dropdown-menu {
    background-color: #fff;
}

header.scrolled .dropdown-menu li a {
    color: #333;
}

/* 下拉菜单项悬停效果 */
.dropdown-menu li:hover {
    background-color: #f5f5f5;
}

.dropdown-menu li:hover a {
    color: #3498db !important; /* 使用important确保悬停颜色优先级 */
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    position: relative;
    z-index: 1;
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.logo span {
    color: #3498db;
}

.nav-links {
    display: flex;
}

.nav-links li {
    margin-left: 30px;
    position: relative; /* 为下拉菜单定位 */
}

/* 定义下划线动画关键帧 */
@keyframes underline {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* 修改导航栏链接的样式 */
.nav-links a {
    font-weight: 500;
    transition: color 0.3s;
    position: relative; /* 设置相对定位 */
}

/* 设置下划线的初始状态 */
.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px; /* 下划线距离链接的距离 */
    height: 2px;
    background-color: #3498db;
    width: 0; /* 初始宽度为 0 */
    transition: width 0.3s ease-in-out; /* 添加过渡效果 */
}

/* 鼠标悬浮时应用动画效果 */
.nav-links a:hover {
    color: #3498db;
}

.nav-links a:hover::after {
    width: 100%; /* 宽度变为 100% */
    animation: underline-middle 0.3s ease-in-out; /* 应用动画 */
}

.mobile-menu {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* 下拉菜单样式 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.dropdown-menu li {
    padding: 6px 12px; /* 调整内边距 */
    text-align: center; /* 确保文本居中 */
    white-space: nowrap; /* 防止文字换行 */
    margin-left: auto;
}

.dropdown-menu li a {
    color: #333;
    font-size: 13px; /* 减小字体大小 */
    font-weight: 500;
    display: block; /* 使整个区域可点击 */
    width: 100%;
    padding: 4px 0; /* 增加垂直间距 */
}

.dropdown-menu li:hover {
    background-color: #f9f9f9;
}

.dropdown-menu li:hover a {
    color: #0066ff;
}

.nav-links li:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

/* 英雄区域 */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url("/img/bg.png");
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    text-align: center;
    color: #fff;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding-top: 70px; /* 补偿固定导航栏的高度 */
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 20px;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    background-color: #3498db;
    color: #fff;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

/* 关于我们 */
.about {
    padding: 100px 0;
    background-color: #fff;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 36px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.section-title p {
    color: #7f8c8d;
    max-width: 700px;
    margin: 0 auto;
}

.about-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.about-text {
    flex: 1;
    padding-right: 40px;
}

.about-text h3 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.about-text p {
    margin-bottom: 20px;
    color: #7f8c8d;
}

.about-image {
    flex: 1;
}

.about-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 服务 */
.services {
    padding: 100px 0;
    background-color: #f9f9f9;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.service-icon {
    font-size: 50px;
    color: #3498db;
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: #2c3e50;
}

/* 联系 */
.contact {
    padding: 100px 0;
    background-color: #fff;
}

.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.contact-info h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.contact-info p {
    margin-bottom: 30px;
    color: #7f8c8d;
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.info-icon {
    font-size: 20px;
    color: #3498db;
    margin-right: 15px;
    margin-top: 5px;
}

.contact-form {
    flex: 1;
    min-width: 300px;
}

.qrcode-container {
    text-align: center;
    margin-top: 10px;
}

.qrcode {
    width: 150px;
    height: 150px;
    border: 1px solid #eee;
    padding: 5px;
    background: white;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

/* 页脚 */
footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 60px 0 20px;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column {
    flex: 1;
    min-width: 250px;
}

.footer-column h3 {
    font-size: 20px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: #3498db;
}

.footer-column p {
    margin-bottom: 20px;
    color: #bdc3c7;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #bdc3c7;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #3498db;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: #34495e;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    transition: background-color 0.3s;
}

.social-links a:hover {
    background-color: #3498db;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
    font-size: 14px;
}

.copyright a{
    text-align: center;
    padding-top: 20px;
    color: #bdc3c7;
    font-size: 14px;
}

.beian {
    text-align: center;
    margin-top: 10px;
    color: #bdc3c7;
    font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .about-content {
        flex-direction: column;
    }

    .about-text {
        padding-right: 0;
        margin-bottom: 40px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: #fff;
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        transition: left 0.3s;
    }

    .nav-links li {
        position: relative;
        margin: 0 0 20px 0;
        padding: 0;
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 12px 20px;
        color: #333;
        font-size: 16px;
        border-bottom: 1px solid #f0f0f0;
    }

    /* 产品演示父项样式 */
    .has-dropdown > a {
        position: relative;
    }

    /* 下拉箭头样式 */
    .has-dropdown > a::after {
        content: "▾";
        position: absolute;
        right: 20px;
        transition: transform 0.3s;
    }

    .has-dropdown > a.active::after {
        content: "▴";
    }

    .dropdown-menu.active {
        max-height: 300px;
    }

    /* 移除最后一个菜单项的下边框 */
    .nav-links li:last-child a {
        border-bottom: none;
    }

    .nav-links li.has-dropdown > a {
        position: relative;
        padding-right: 20px; /* 为箭头留出空间 */
    }

    .nav-links li.has-dropdown > a::after {
        content: "\f078"; /* FontAwesome向下箭头 */
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        font-size: 12px;
        transition: transform 0.3s ease;
    }

    /* 展开状态时箭头向上 */
    .nav-links li.has-dropdown > a.active::after {
        content: "\f077"; /* FontAwesome向上箭头 */
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background-color: transparent;
        transform: none;
        padding: 0;
        display: block !important;
    }

    .dropdown-menu li {
        padding: 6px 0;
        margin: 0;
        text-align: left;
    }

    .dropdown-menu li a {
        padding-left: 40px !important;
        font-size: 15px;
        color: #666 !important;
    }

    .nav-links.active {
        left: 0;
    }

    .mobile-menu {
        display: block;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero p {
        font-size: 18px;
    }

    /* 移动端菜单文字颜色 */
    header:not(.scrolled) .nav-links.active a {
        color: #333;
    }

    header:not(.scrolled) .dropdown-menu {
        background-color: rgba(255, 255, 255, 0.95); /* 半透明白色背景 */
    }

    header:not(.scrolled) .dropdown-menu li a {
        color: #333; /* 深色文字确保可见 */
    }

    /* 滚动状态下保持原有样式 */
    header.scrolled .dropdown-menu {
        background-color: #fff;
    }

    header.scrolled .dropdown-menu li a {
        color: #333;
    }

    /* 下拉菜单项悬停效果 */
    .dropdown-menu li:hover {
        background-color: #f5f5f5;
    }

    .dropdown-menu li:hover a {
        color: #3498db !important; /* 使用important确保悬停颜色优先级 */
    }

    /* 添加指示箭头 */
    .nav-links li > a:not(:only-child)::after {
        content: ""; /* 使用更简洁的箭头符号，可以替换为其他字符或图标 */
        font-size: 12px;
        display: inline; /* 确保与文字同行 */
        margin-left: 4px; /* 添加少量间距 */
        vertical-align: middle; /* 垂直居中 */
    }
}