body {
    font-family: "Noto Sans SC", sans-serif ;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    background: linear-gradient(135deg, #eeeeee, #eeeeee);
    margin: 0;
    animation: fadeIn 1.5s ease-in-out; /* 添加淡入动画 */
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* 确保页面高度至少为视口高度 */
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.navbar {
    z-index: 2;
    background: #3f72af;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .name {
    font-size: 18px;
    font-weight: bold;
}

.navbar a {
    color: #fff;
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
    transition: color 0.3s ease, transform 0.3s ease; /* 添加颜色和缩放动画 */
}

.navbar a:hover {
    text-decoration: underline;
    color: #dbe2ef; 
    transform: scale(1.3); /* 悬停时放大 */
}

/* 内容容器 */
.container {
    position: relative; /* 确保内容在背景上方 */
    z-index: 1; /* 提升内容层级 */
    max-width: 700px;
    margin: 40px auto;
    padding: 30px;
    border-radius: 20px;
    background: #fff; /* 添加白色背景以区分内容和背景 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex: 1; /* 让内容区域占据剩余空间 */
    padding: 20px;
    animation: fadeIn 1.5s ease-in-out; /* 添加淡入动画 */
}

h1 { 
    color: #333; 
    text-align: center;
}
p { 
    color: #555; 
    line-height: 1.6;
}
ul {
    list-style: none;
    padding: 0;
}
ul li {
    margin: 10px 0;
    color: #333;
}
.profile-img {
    display: block;
    width: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    border: 4px solid #0078d4;
    position: relative;
    z-index: 1;
    transition: transform 0.5s ease; /* 添加缩放动画 */
}
.profile-img:hover {
    transform: scale(1.2); /* 鼠标悬停时放大 */
}
.links {
    margin-top: 30px; 
    text-align: center;
}
.links a {
    margin: 0 10px;
    color: #0078d4;
    text-decoration: none;
    padding: 8px 15px;
    border: 1px solid #0078d4;
    border-radius: 20px;
    transition: all 0.3s ease; /* 添加平滑过渡动画 */
    display: inline-block;
}
.links a:hover {
    background: #0078d4;
    color: #fff;
    transform: translateY(-5px); /* 鼠标悬停时向上移动 */
}
/* 初始状态：透明且向下偏移 */
.fade-in {
    opacity: 0; /* 初始透明 */
    transform: translateY(10px); /* 初始向下偏移 */
    transition: opacity 1s ease, transform 1s ease; /* 渐变效果 */
}

/* 当元素进入视口时的状态 */
.fade-in.show {
    opacity: 1; /* 完全显示 */
    transform: translateY(0); /* 回到原始位置 */
}
/* spacer 样式 */
.spacer {
    z-index: 1;
    margin-top: 25%; /* 将 spacer 推到下一屏幕 */
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
    height: auto; /* 设置 spacer 的高度 */
    background: #f9f9f9; /* 设置背景颜色 */
    border-radius: 20px; /* 添加圆角 */
    width: 75%; /* 设置宽度 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
    padding: 20px; /* 添加内边距 */
    display: flex; /* 启用 flexbox 布局 */
    flex-direction: column; /* 设置内容竖直排列 */
    justify-content: left; /* 垂直居中内容 */
    align-items: center; /* 水平居中内容 */
    gap: 10px; /* 设置内容之间的间距 */
    color: #333; /* 设置文字颜色 */
    font-size: 18px; /* 设置文字大小 */
    text-align: left; /* 居中文本 */
}

.skills{
    z-index: 1;
    height: auto; /* 设置 spacer 的高度 */
    background: #f9f9f9; /* 设置背景颜色 */
    border-radius: 20px; /* 添加圆角 */
    margin: 20px auto; /* 增加与其他元素的距离 */
    width: 75%; /* 设置宽度 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
    padding: 20px; /* 添加内边距 */
    display: flex; /* 启用 flexbox 布局 */
    flex-direction: column; /* 设置内容竖直排列 */
    justify-content: left; /* 垂直居中内容 */
    align-items: center; /* 水平居中内容 */
    gap: 10px; /* 设置内容之间的间距 */
    color: #333; /* 设置文字颜色 */
    font-size: 18px; /* 设置文字大小 */
    text-align: left; /* 居中文本 */
}

.contact{
    z-index: 1;
    height: auto; /* 设置 spacer 的高度 */
    background: #f9f9f9; /* 设置背景颜色 */
    border-radius: 20px; /* 添加圆角 */
    margin: 20px auto; /* 增加与其他元素的距离 */
    width: 75%; /* 设置宽度 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
    padding: 20px; /* 添加内边距 */
    display: flex; /* 启用 flexbox 布局 */
    flex-direction: column; /* 设置内容竖直排列 */
    justify-content: left; /* 垂直居中内容 */
    align-items: center; /* 水平居中内容 */
    gap: 10px; /* 设置内容之间的间距 */
    color: #333; /* 设置文字颜色 */
    font-size: 18px; /* 设置文字大小 */
    text-align: left; /* 居中文本 */
}
.skills:hover{
    transform: translateY(-5px); /* 悬停时向上移动 */
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2); /* 悬停时阴影加深 */
}
/* 悬停效果 */
.spacer:hover {
    transform: translateY(-5px); /* 悬停时向上移动 */
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2); /* 悬停时阴影加深 */
}

.contact:hover{
    transform: translateY(-5px); /* 悬停时向上移动 */
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2); /* 悬停时阴影加深 */
}

footer {
    z-index: 1; /* 确保 footer 在内容上方 */
    position: relative; /* 确保 footer 的位置可以被 z-index 控制 */
    text-align: center;
    margin: 20px auto; /* 水平居中 */
    bottom: 0; /* 距离页面底部 20px */
    width: fit-content; /* 根据内容自动调整宽度 */
    padding: 10px 20px; /* 内边距，形成胶囊状 */
    background: #fff; /* 背景颜色 */
    color: #333; /* 文字颜色 */
    border-radius: 50px; /* 圆角，形成胶囊状 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
    font-size: 14px;
}

/* 打字机效果 */
.typing {
    font-size: 24px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    /* border-right: 2px solid #0078d4; */
    width: 20ch; /* 设置最终宽度，确保文字不会消失 */
    margin: 0 auto; /* 水平居中 */
    text-align: center; /* 确保文字居中 */
    animation: typing 2s steps(20, end), blink 0.5s step-end 4s; /* 光标闪烁动画在 4 秒后停止 */
}

/* 打字机动画 */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 20ch; /* 根据文字长度调整 */
    }
}

/* 光标闪烁动画 */
@keyframes blink {

}

/* 全屏视差背景并添加高斯模糊 */
.parallax {
    position: absolute; /* 让背景固定在页面顶部 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* 设置高度为视口高度 */
    background-image: url("https://s2.loli.net/2025/10/04/nFO2zfUypj5dikN.jpg"); /* 替换为你的背景图片 */
    background-attachment: fixed; /* 固定背景以实现视差效果 */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover; /* 确保背景图片覆盖整个屏幕 */
    z-index: 0; /* 将背景置于内容下方 */
    transition: filter 5s ease; /* 添加平滑过渡效果 */
    filter: blur(8px);
}