/* 全局重置：清除默认边距和内边距，统一盒模型 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 页面主体样式：设置字体、背景图、最小高度，确保页面占满屏幕 */
body {
    font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    background: #e0e5ec url('bg.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 背景层：独立背景图容器，实现固定背景效果 */
.anime-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -3;
    filter: blur(0px);
}

/* 背景遮罩：半透明层，增强文字可读性，优化视觉层次 */
.anime-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(224, 229, 236, 0.15);
    z-index: -2;
}

/* 主容器：限制页面最大宽度，居中布局，设置内边距 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 头部区域：拟态风格卡片，居中对齐，设置内边距和阴影 */
.header {
    text-align: center;
    margin-bottom: 50px;
    background: rgba(224, 229, 236, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 40px 20px;
    box-shadow: 
        10px 10px 20px rgba(163, 177, 198, 0.5),
        -10px -10px 20px rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 头像容器：拟态圆形，居中显示，设置阴影和边框 */
.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background: rgba(224, 229, 236, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #000000;
    box-shadow: 
        8px 8px 15px rgba(163, 177, 198, 0.5),
        -8px -8px 15px rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 头像图片：填充容器，圆形裁剪，添加内阴影增强质感 */
.avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 
        inset 3px 3px 5px rgba(163, 177, 198, 0.3),
        inset -3px -3px 5px rgba(255, 255, 255, 0.4);
}

/* 姓名标题：放大字体，加粗，添加文字阴影增强立体感 */
.name {
    font-size: 2.5em;
    color: #000000;
    margin-bottom: 10px;
    font-weight: bold;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.1),
        -1px -1px 2px rgba(255, 255, 255, 0.3);
}

/* 一言容器：调整字体大小、颜色和行高，确保与原风格统一 */
.qq-info {
    font-size: 1.1em;
    color: #333333;
    margin-bottom: 20px;
    font-weight: 500;
    line-height: 1.6;
}

/* 一言来源：区分正文，设置斜体和颜色 */
.hitokoto-from {
    font-size: 0.9em;
    color: #666666;
    font-style: italic;
    margin-top: 5px;
    display: block;
}

/* 描述文字：设置字体大小和颜色，简洁说明页面用途 */
.description {
    font-size: 1.2em;
    color: #333333;
    margin-bottom: 20px;
}

/* 导航菜单：弹性布局，居中对齐，设置间距 */
.nav-menu {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
}

/* 导航菜单项：拟态按钮，设置内边距、阴影和过渡效果 */
.nav-item {
    background: rgba(224, 229, 236, 0.7);
    backdrop-filter: blur(5px);
    padding: 12px 25px;
    border-radius: 50px;
    text-decoration: none;
    color: #000000;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 
        5px 5px 10px rgba(163, 177, 198, 0.5),
        -5px -5px 10px rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 导航菜单项悬停：上浮、增强阴影，优化交互体验 */
.nav-item:hover {
    transform: translateY(-3px);
    box-shadow: 
        8px 8px 15px rgba(163, 177, 198, 0.5),
        -8px -8px 15px rgba(255, 255, 255, 0.6);
    color: #333333;
}

/* 内容区域：网格布局，自适应列数，设置间距 */
.content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* 内容卡片：拟态风格，设置内边距、阴影和过渡效果 */
.card {
    background: rgba(224, 229, 236, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        8px 8px 15px rgba(163, 177, 198, 0.5),
        -8px -8px 15px rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 卡片悬停：上浮、增强阴影，提升交互感 */
.card:hover {
    transform: translateY(-5px);
    box-shadow: 
        12px 12px 20px rgba(163, 177, 198, 0.5),
        -12px -12px 20px rgba(255, 255, 255, 0.6);
}

/* 卡片标题：设置字体大小、颜色，弹性布局对齐图标和文字 */
.card-title {
    font-size: 1.5em;
    color: #000000;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 卡片内容：设置文字颜色和行高，提升可读性 */
.card-content {
    color: #5a5a5a;
    line-height: 1.6;
}

/* 社交链接容器：弹性布局，居中对齐，设置间距 */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    width: 100%;
    text-align: center;
}

/* 社交链接图标：拟态圆形按钮，设置大小、阴影和过渡效果 */
.social-link {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(224, 229, 236, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #000000;
    font-size: 12px;
    transition: all 0.3s ease;
    box-shadow: 
        5px 5px 10px rgba(163, 177, 198, 0.5),
        -5px -5px 10px rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 社交链接悬停：上浮、放大，增强交互反馈 */
.social-link:hover {
    transform: translateY(-3px) scale(1.1);
    color: #333333;
}

/* 页脚：拟态风格，居中对齐，设置内边距和阴影 */
.footer {
    text-align: center;
    padding: 30px;
    background: rgba(224, 229, 236, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    color: #333333;
    box-shadow: 
        8px 8px 15px rgba(163, 177, 198, 0.5),
        -8px -8px 15px rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 樱花元素：固定定位，设置颜色和指针事件（不干扰页面操作） */
.sakura {
    position: fixed;
    top: -10px;
    z-index: 999;
    color: #ffb6c1;
    user-select: none;
    pointer-events: none;
    opacity: 0.8;
    font-size: 1.2em;
    will-change: transform;
    animation: falling linear forwards;
}

/* 樱花飘落动画：从顶部坠落到底部 */
@keyframes falling {
    to {
        transform: translateY(calc(100vh + 20px));
    }
}

/* 一言加载动画：圆形旋转，提示加载状态 */
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #333333;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 8px;
}

/* 加载动画旋转效果 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 移动端适配：针对小屏幕调整布局和字体大小 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    .header, .card, .footer {
        padding: 25px 15px;
        border-radius: 15px;
        text-align: center;
    }
    .nav-menu {
        gap: 15px;
    }
    .nav-item {
        padding: 10px 20px;
    }
    .content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .card-content, .card-title {
        text-align: center;
        justify-content: center;
    }
    .social-links {
        flex-wrap: wrap;
        gap: 15px;
    }
    .avatar {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }
    .name {
        font-size: 2em;
    }
    .description, .qq-info {
        font-size: 1em;
    }
}