/* 通用样式 */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* 现代字体 */
    background-color: #1a1a2e; /* 深蓝紫色背景 */
    color: #e0e0e0; /* 浅色文字 */
    overflow-x: hidden; /* 防止粒子效果轻微溢出时出现水平滚动条 */
    height: 100%;
}

.container {
    position: relative; /* 确保内容在粒子背景之上 */
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh; /* 确保容器占据整个视口高度 */
    padding: 20px;
    box-sizing: border-box;
}

/* 粒子背景 */
#particles-js {
    position: fixed; /* 固定位置以覆盖全屏 */
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0; /* 在所有内容之后 */
}

/* 头部和标题 */
header {
    width: 100%;
    text-align: center;
    margin-bottom: 40px; /* 标题下方的间距 */
}

.animated-title {
    font-size: 2.5rem; /* 基础字体大小 */
    color: #fff;
    font-weight: bold;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #00c6ff, #0072ff, #f0f, #00c6ff); /* 鲜艳的渐变色 */
    background-size: 300% 100%; /* 更宽的渐变以实现更平滑的动画 */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-flow 8s linear infinite; /* 更慢、更平滑的动画 */
    text-shadow: 0 0 8px rgba(0, 198, 255, 0.6), 0 0 15px rgba(255, 0, 255, 0.4);
    margin-top: 5vh;
    margin-bottom: 5vh;
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; } /* 匹配 background-size */
}

/* 导航网格 */
#navigation-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px; /* 增加间隙 */
    padding: 0 20px; /* 网格本身的内边距 */
    width: 100%;
    max-width: 1200px; /* 较大屏幕的最大宽度 */
}

.nav-item {
    background-color: rgba(40, 58, 100, 0.6); /* 半透明深蓝色 */
    color: #c0d0f0; /* 淡蓝色文本 */
    padding: 20px 25px;
    text-decoration: none;
    border-radius: 10px; /* 更柔和的圆角 */
    font-size: 1.1rem;
    text-align: center;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, background-color 0.2s ease-out;
    min-width: 220px; /* 略宽一些 */
    border: 1px solid rgba(0, 198, 255, 0.3); /* 微弱的边框 */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.nav-item:hover {
    transform: translateY(-5px) scale(1.03); /* 向上浮动并轻微放大 */
    background-color: rgba(50, 70, 130, 0.8); /* 悬停时颜色变浅 */
    color: #ffffff;
    box-shadow: 0 0 12px rgba(0, 198, 255, 0.6), /* 青色光晕 */
                0 0 20px rgba(0, 198, 255, 0.4), /* 更宽的青色光晕 */
                0 8px 20px rgba(0, 0, 0, 0.4); /* 更强的阴影 */
    border-color: rgba(0, 198, 255, 0.7);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .animated-title {
        font-size: 2rem; /* 移动端标题缩小 */
        margin-top: 8vh;
        margin-bottom: 6vh;
    }

    #navigation-grid {
        flex-direction: column; /* 垂直堆叠项目 */
        align-items: center; /* 在列中居中项目 */
        gap: 20px;
    }

    .nav-item {
        width: 80%; /* 移动端项目更宽 */
        max-width: 350px; /* 但不要太宽 */
        padding: 18px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .animated-title {
        font-size: 1.6rem;
    }
    .nav-item {
        width: 90%;
        padding: 15px;
        font-size: 0.95rem;
    }
}