/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", Arial, sans-serif;
}

/* 基础变量 */
:root {
    --primary-color: #0f4c81; /* 主色调-电力蓝 */
    --secondary-color: #1565c0; /* 辅助色 */
    --light-color: #f8f9fa; /* 浅背景色 */
    --dark-color: #333; /* 深文本色 */
    --gray-color: #666; /* 灰色文本 */
    --light-gray: #eee; /* 浅灰色 */
    --white: #fff; /* 白色 */
    --shadow: 0 2px 8px rgba(0,0,0,0.1); /* 基础阴影 */
}

/* 通用样式 */
body {
    color: var(--dark-color);
    line-height: 1.6;
    background-color: var(--white);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

h1, h2, h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

p {
    margin-bottom: 1rem;
    color: var(--gray-color);
}

/* 语言切换按钮 */
.lang-switch {
    display: flex;
    gap: 8px;
}

.lang-btn {
    padding: 8px 16px;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    background-color: var(--white);
    color: var(--primary-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.lang-btn.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(15, 76, 129, 0.3);
    transform: translateY(-1px);
}

.lang-btn:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
    box-shadow: 0 4px 8px rgba(21, 101, 192, 0.3);
    transform: translateY(-1px);
}

/* 隐藏非当前语言的内容 - 修复：统一显示属性，适配块级/行内元素 */
.en-text {
    display: none;
}

body.en .cn-text {
    display: none;
}

/* 改动1：将inline改为inline-block，适配更多元素类型 */
body.en .en-text {
    display: inline-block;
}

/* 导航栏样式 */
.navbar {
    background-color: var(--white);
    color: var(--primary-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: var(--shadow);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--dark-color);
    font-size: 1rem;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-links a.active, .nav-links a:hover {
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-color);
}

/* 图片轮动样式 */
.slider {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slider-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slider-item.active {
    opacity: 1;
}

.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--white);
    background-color: rgba(0, 0, 0, 0.6);
    padding: 2rem;
    border-radius: 8px;
    max-width: 800px;
}

.slider-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.slider-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--white);
    opacity: 0.9;
}

.slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
}

.prev-btn, .next-btn {
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev-btn:hover, .next-btn:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: var(--white);
    color: var(--primary-color);
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background-color: #e0e0e0;
    color: var(--secondary-color);
}

.btn-sm {
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
}

.mt-2 {
    margin-top: 2rem;
}

.mt-3 {
    margin-top: 3rem;
}

/* 核心优势区域 */
.advantages {
    padding: 4rem 0;
    background-color: var(--light-color);
}

.advantages h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.advantage-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

/* 改动2：补全变量引用 --primary-color，添加闭合符号 } */
.card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color); /* 修复：补全完整变量名 --primary-color */
} /* 修复：添加样式块闭合符号 */

/* 改动3：补充页面标题样式（适配产品/应用/服务/联系我们页面） */
.page-title {
    padding: 3rem 0;
    background-color: var(--light-color);
    text-align: center;
}

.page-title h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
}

.page-title p {
    font-size: 1.1rem;
    color: var(--gray-color);
}

/* 改动4：补充产品列表样式 */
.product-list {
    padding: 3rem 0;
}

.product-detail {
    display: flex;
    gap: 2rem;
    margin-bottom: 4rem;
    align-items: center;
}

.product-detail-img {
    width: 40%;
    height: 250px;
    background-color: var(--light-gray);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: bold;
}

.product-detail-content {
    width: 60%;
}

.product-specs {
    margin: 1rem 0 2rem 2rem;
    list-style: disc;
    color: var(--gray-color);
}

/* 改动5：补充应用场景样式 */
.application-list {
    padding: 3rem 0;
}

.application-card {
    display: flex;
    gap: 2rem;
    margin-bottom: 4rem;
    align-items: center;
}

.application-card.reverse {
    flex-direction: row-reverse;
}

.application-img {
    width: 40%;
    height: 250px;
    background-color: var(--light-gray);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: bold;
}

.application-content {
    width: 60%;
}

.application-content ul {
    margin: 1rem 0 1rem 2rem;
    list-style: disc;
    color: var(--gray-color);
}

/* 改动6：补充服务列表样式 */
.service-list {
    padding: 3rem 0;
}

.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.service-card ul {
    margin: 1rem 0 1rem 2rem;
    list-style: disc;
    color: var(--gray-color);
}

.service-guarantee {
    padding: 3rem 0;
    background-color: var(--light-color);
    margin-top: 2rem;
}

.service-guarantee h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.guarantee-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.guarantee-card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

/* 改动7：补充联系我们页面样式 */
.contact-section {
    padding: 3rem 0;
    display: flex;
    gap: 3rem;
}

.contact-info {
    width: 40%;
}

.contact-form {
    width: 60%;
}

.contact-item {
    margin-bottom: 1.5rem;
    color: var(--gray-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    font-size: 1rem;
    color: var(--dark-color);
}

.form-group textarea {
    resize: vertical;
}

.submit-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: var(--white);
}

.submit-btn:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* 改动8：补充页脚样式 */
.footer {
    background-color: #000;
    color: var(--white);
    padding: 3rem 0;
    margin-top: 3rem;
}

.footer-top {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h3 {
    color: var(--white);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.footer-col p {
    color: #ccc;
    line-height: 1.8;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
    color: #ccc;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #ccc;
}

/* 改动9：补充移动端适配（媒体查询） */
@media (max-width: 768px) {
    /* 导航栏适配 */
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* 横幅适配 */
    .banner h1 {
        font-size: 2rem;
    }
    
    /* 产品详情适配 */
    .product-detail {
        flex-direction: column;
    }
    
    .product-detail-img, .product-detail-content {
        width: 100%;
    }
    
    /* 应用场景适配 */
    .application-card {
        flex-direction: column;
    }
    
    .application-card.reverse {
        flex-direction: column;
    }
    
    .application-img, .application-content {
        width: 100%;
    }
    
    /* 联系我们适配 */
    .contact-section {
        flex-direction: column;
    }
    
    .contact-info, .contact-form {
        width: 100%;
    }
    
    /* 优势卡片适配 */
    .advantage-cards {
        grid-template-columns: 1fr;
    }
}