/* ===========================
   全局样式和CSS变量
   =========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a4d7a;
    --secondary-color: #2c6ba1;
    --accent-color: #f39c12;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --background-light: #f8f9fa;
    --border-color: #dfe6e9;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #fff;
}

/* ===========================
   头部和导航
   =========================== */

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* 语言切换按钮 */
.lang-switch {
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s;
}

.lang-switch:hover {
    background: rgba(255,255,255,0.2);
    color: white !important;
}

/* 汉堡菜单按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: all 0.3s;
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ===========================
   搜索框样式
   =========================== */

.search-container {
    position: relative;
}

.search-box {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 0.9rem;
    width: 250px;
    transition: all 0.3s;
}

.search-box:focus {
    outline: none;
    background: rgba(255,255,255,0.2);
    border-color: var(--accent-color);
    width: 300px;
}

.search-box::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.7);
}

/* ===========================
   搜索结果下拉框
   =========================== */

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
    margin-top: 10px;
    display: none;
    z-index: 1001;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--background-light);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.search-result-excerpt {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.search-highlight {
    background: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
}

.no-results {
    padding: 1.5rem;
    text-align: center;
    color: #666;
}

/* ===========================
   Hero横幅区域
   =========================== */

.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 150px 2rem 100px;
    text-align: center;
    margin-top: 70px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.2s;
    animation-fill-mode: both;
}

.cta-button {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 1rem 2.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
    animation: fadeInUp 1s ease 0.4s;
    animation-fill-mode: both;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(243, 156, 18, 0.4);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   通用区块样式
   =========================== */

section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
}

/* ===========================
   关于我们区域
   =========================== */

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

.about-text {
    font-size: 1.1rem;
}

.about-text p {
    margin-bottom: 1rem;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.stat-card {
    background: var(--background-light);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid var(--accent-color);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: #666;
    margin-top: 0.5rem;
}

/* ===========================
   产品展示区域
   =========================== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    text-align: center;
    font-size: 3rem;
}

.product-content {
    padding: 1.5rem;
}

.product-content h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* ===========================
   服务区域
   =========================== */

#services {
    background: var(--background-light);
    padding: 4rem 2rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.service-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-5px);
}

.service-icon {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.service-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* ===========================
   联系我们区域
   =========================== */

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.contact-info {
    background: var(--background-light);
    padding: 2rem;
    border-radius: 10px;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.contact-item span {
    margin-right: 1rem;
    font-size: 1.5rem;
    color: var(--accent-color);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea {
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

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

.submit-button {
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-button:hover {
    background: var(--secondary-color);
}

/* ===========================
   页脚
   =========================== */

footer {
    background: var(--text-dark);
    color: white;
    text-align: center;
    padding: 2rem;
}

/* ===========================
   响应式设计
   =========================== */

@media (max-width: 768px) {
    header {
        padding: 0.5rem 0;
    }

    nav {
        flex-wrap: wrap;
        padding: 0 1rem;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        display: none !important;
        flex-direction: column;
        width: 100%;
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        position: absolute;
        top: 100%;
        left: 0;
        padding: 1rem 0;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        gap: 0;
        z-index: 999;
    }

    .nav-links.active {
        display: flex !important;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        padding: 1rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

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

    .search-container {
        width: 100%;
        padding: 1rem;
    }

    .search-box {
        width: 100%;
        max-width: 300px;
    }

    .search-box:focus {
        width: 100%;
        max-width: 300px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
    }

    .products-grid,
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    /* 语言切换按钮在移动端菜单中显示 */
    .lang-switch {
        display: block;
        width: auto;
        margin: 0 auto;
    }
}
