/* styles.css */

/* 通用样式 */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #f4f4f4;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background: linear-gradient(90deg, #0044cc, #0066ff);
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: static; /* 设置为static以固定在页面顶部 */
    width: 100%;
    top: 0;
    z-index: 1000; /* 确保header在最上层 */
    transition: background 0.5s ease;
}

header .logo {
    font-size: 24px; /* 修改logo的字体大小 */
    font-weight: bold;
    transition: transform 0.5s ease;
}

header nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-between;
}

header nav ul li {
    position: relative;
}

header nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 10px 15px; /* 缩小padding以匹配较小的字体 */
    transition: color 0.3s ease;
    font-size: 14px; /* 修改字体大小 */
}

header nav ul li a:hover {
    color: #ff6600;
}

header nav ul li a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #ff6600;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

header nav ul li a:hover::before {
    transform: scaleX(1);
}

.hero {
    background: url('https://mhz-image.teknologiinformatika.eu.org/file/32b835ff65abd0e9be36b.jpg') no-repeat center center/cover;
    color: white;
    text-align: center;
    padding: 150px 0; /* 增加整体内边距，以避免内容被header遮挡 */
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    transform: translateY(30px);
    opacity: 0;
    animation: fadeInUp 1.5s ease forwards;
}

.hero-content h1 {
    font-size: 56px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.hero-content p {
    font-size: 22px;
    margin-bottom: 40px;
}

.cta-button {
    background-color: #ff6600;
    color: white;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 50px;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.about, .services {
    padding: 80px 0;
    background-color: white;
    margin-bottom: 20px;
    animation: fadeIn 1.5s ease forwards;
    opacity: 0;  /* 初始设置为透明 */
    transform: translateY(30px);  /* 初始位置偏移 */
}

.about h2, .services h2 {
    font-size: 36px;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
    opacity: 1; /* 确保标题部分显示 */
}

.about h2::after, .services h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #ff6600;
}

.service-item {
    background-color: #f9f9f9;
    padding: 30px;
    margin-bottom: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 1; /* 确保服务项显示 */
}

.service-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.service-item h3 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #0044cc;
}

.service-item p {
    font-size: 18px;
    color: #666;
}

.contact {
    padding: 80px 0;
    background-color: #0044cc;
    color: white;
    text-align: center;
}

.contact h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.contact p {
    font-size: 18px;
    margin-bottom: 10px;
}

footer {
    padding: 30px 0;
    background-color: #333;
    color: white;
    text-align: center;
}

footer p {
    margin: 0;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .container {
        width: 95%;
    }

    header .logo {
        font-size: 24px;
        text-align: center;
        margin-bottom: 10px;
    }

    header nav ul {
        flex-direction: column;
        align-items: center;
    }

    header nav ul li {
        margin-bottom: 10px;
    }

    header nav ul li a {
        font-size: 12px; /* 修改移动端字体大小 */
    }

    .hero-content h1 {
        font-size: 32px;
        margin-bottom: 15px;
    }

    .hero-content p {
        font-size: 18px;
        margin-bottom: 25px;
    }

    .cta-button {
        padding: 12px 30px;
        font-size: 16px;
    }

    .about, .services {
        padding: 60px 20px;
    }

    .service-item {
        padding: 20px;
        margin-bottom: 15px;
    }

    footer {
        padding: 20px 0;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
