/* 全局样式和变量 */
:root {
    --primary-color: #004d99;
    --secondary-color: #ff6600;
    --background-color: #f4f7f9;
    --card-bg-color: #ffffff;
    --text-color: #333333;
    --light-text-color: #666666;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    /* 移除 flexbox 居中，改为正常的文档流 */
}

/* 为页面内容添加居中和适当的间距 */
body::before {
    content: '';
    display: block;
    height: 5vh; /* 顶部留白 */
    min-height: 20px;
}

/* 确保页面有足够的内容高度 */
html {
    scroll-behavior: smooth;
    /* 防止移动端回弹 */
    overscroll-behavior: none;
}

body {
    /* 防止移动端橡皮筋效果 */
    overscroll-behavior-y: none;
}

/* 额外的移动端优化 */
@supports (height: 100dvh) {
    body {
        min-height: 100dvh;
    }
}

.container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto; /* 水平居中 */
    text-align: center;
    padding-bottom: 20px; /* 底部留白 */
}

/* 头部样式 */
.header {
    margin-bottom: 40px;
}

.logo {
    max-width: 150px; /* 限制最大宽度 */
    height: auto;    /* 保持宽高比 */
    margin-bottom: 20px;
}

.main-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--light-text-color);
}

/* 卡片容器样式 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* 卡片样式 */
.card {
    background-color: var(--card-bg-color);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
    line-height: 1;
}

.card-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.card-description {
    font-size: 1rem;
    color: var(--light-text-color);
}

/* 底部样式 */
.footer {
    margin-top: 40px;
    border-top: 1px solid rgba(0, 77, 153, 0.2);
    padding-top: 30px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.copyright-section {
    text-align: center;
}

.copyright-section p {
    font-size: 0.9rem;
    color: var(--light-text-color);
    margin: 0;
}

.language-section {
    text-align: center;
}

.section-title {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 600;
    margin: 0 0 10px 0;
    border-bottom: 2px solid var(--secondary-color);
    display: inline-block;
    padding-bottom: 2px;
}

/* 底部语言切换器样式 */
.language-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 0.9rem;
}

.lang-option {
    color: var(--light-text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid transparent;
}

.lang-option:hover {
    color: var(--primary-color);
    background-color: rgba(0, 77, 153, 0.1);
    border-color: rgba(0, 77, 153, 0.3);
}

.lang-option.active {
    color: white;
    background-color: var(--primary-color);
    font-weight: 600;
    border-color: var(--primary-color);
}

/* JavaScript 动画所需样式 */
@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.fade-in {
    opacity: 0;
    animation: fadeInCard 0.6s ease forwards;
}

/* 媒体查询 - 针对小屏幕设备 */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .card-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card {
        padding: 25px;
    }

    /* 移动端底部样式调整 */
    .footer {
        margin-top: 30px;
        padding-top: 20px;
    }

    .footer-content {
        gap: 15px;
    }

    .section-title {
        font-size: 0.9rem;
    }

    .language-switcher {
        font-size: 0.8rem;
        gap: 10px;
        flex-wrap: wrap;
    }

    .lang-option {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    /* 移动端滚动优化 */
    body {
        -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
        overflow-x: hidden; /* 防止水平滚动 */
    }

    body::before {
        height: 2vh; /* 移动端减少顶部留白 */
        min-height: 10px;
    }

    .container {
        padding-bottom: 10px; /* 移动端减少底部留白 */
    }
}