/* ========== 基础重置和全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edf5 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
}

/* ========== 粒子背景 ========== */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* ========== 主容器 ========== */
main {
    position: relative;
    z-index: 1;
    padding: 1rem;
}

.fade-in {
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 头像容器 ========== */
.avatar-container {
    position: relative;
    transition: transform 0.3s ease;
}

.avatar-container:hover {
    transform: scale(1.05);
}

/* ========== 社交媒体链接 ========== */
.social-link-card {
    text-decoration: none;
    display: inline-block;
}

.wechat-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.social-link-card:hover .wechat-icon-img {
    transform: scale(1.1);
}

/* ========== 技术标签 ========== */
.tech-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    transition: all 0.3s ease;
    cursor: default;
}

.tech-badge:hover {
    border-color: #3b82f6;
    color: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* ========== 进度条动画 ========== */
.progress-bar {
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ========== 统计数字动画 ========== */
.stat-number {
    transition: all 0.3s ease;
}

.stat-card {
    transition: all 0.3s ease;
    cursor: default;
}

.stat-card:hover .stat-number {
    transform: scale(1.05);
}

/* ========== 友情链接 ========== */
.friend-link {
    text-decoration: none;
    display: inline-block;
}

.friend-link > div {
    transition: all 0.3s ease;
}

.friend-link:hover > div {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

/* ========== 返回顶部按钮 ========== */
.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/* ========== 响应式调整 ========== */
@media (max-width: 640px) {
    main {
        padding: 0.5rem;
    }
    
    .back-to-top-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .tech-badge {
        font-size: 0.65rem;
        padding: 0.3rem 0.6rem;
    }
}

@media (min-width: 768px) {
    .fade-in {
        animation: fadeInUp 1s ease-out;
    }
}

/* ========== 打印优化 ========== */
@media print {
    .particles-container,
    #particles-js,
    .back-to-top-btn {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .bg-white\/80 {
        background: white !important;
        backdrop-filter: none !important;
    }
}