/* --- 1. 变量与重置 --- */
:root {
    /* 现代配色方案 - 保持不变 */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #0f172a;
    --accent: #3b82f6;
    --text-main: #334155;
    --text-light: #64748b;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    
    /* 布局与效果 */
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- 2. 导航栏 --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8); /* 稍微降低透明度以增强模糊感 */
    backdrop-filter: blur(12px); /* 增强模糊 */
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all 0.4s ease;
}
/* 滚动时导航栏变窄的动画效果在JS中触发 */
header.scrolled {
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    transition: height 0.4s ease;
}
header.scrolled .navbar-container { height: 60px; }

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: -0.5px;
    position: relative;
    overflow: hidden;
}
.logo span { color: var(--primary); }
/* Logo 滑光效果 */
.logo::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    transition: 0.5s;
}
.logo:hover::after { left: 100%; }


.nav-links { display: flex; gap: 40px; }
.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-main);
    position: relative;
    transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); transform: translateY(-2px); }
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%; /* 从中心向两边展开 */
    transform: translateX(-50%);
    background-color: var(--primary);
    transition: width 0.3s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.menu-toggle { display: none; cursor: pointer; flex-direction: column; gap: 6px; }
.bar { width: 25px; height: 2px; background-color: var(--secondary); transition: all 0.3s ease; border-radius: 2px;}

/* --- 3. 英雄区域 (Hero) & 新增动画 --- */
.hero {
    position: relative;
    padding: 180px 0 120px;
    overflow: hidden;
}

/* 背景缓慢脉冲动画 */
@keyframes pulse-slow {
    0% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.08) translate(20px, -20px); }
    100% { transform: scale(1) translate(0, 0); }
}
.hero-bg-shape {
    position: absolute;
    top: -25%;
    right: -15%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: -1;
}
.pulse-animation { animation: pulse-slow 12s infinite ease-in-out; }

.hero-content { text-align: center; max-width: 800px; margin: 0 auto; }

/* 徽章漂浮动画 */
@keyframes float {
    0% { transform: translateY(0px); box-shadow: var(--shadow-sm); }
    50% { transform: translateY(-8px); box-shadow: var(--shadow-md); }
    100% { transform: translateY(0px); box-shadow: var(--shadow-sm); }
}
.badge {
    display: inline-block;
    padding: 8px 20px;
    background: #eff6ff;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 50px;
    margin-bottom: 25px;
    border: 1px solid #dbeafe;
}
.float-animation { animation: float 3s ease-in-out infinite; }

.hero h1 {
    font-size: 3.8rem;
    line-height: 1.15;
    color: var(--secondary);
    margin-bottom: 25px;
    font-weight: 800;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 45px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons { display: flex; gap: 20px; justify-content: center; }

/* 按钮动效增强 */
.btn {
    padding: 14px 36px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s var(--bounce);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.3);
}
/* 按钮背景滑动填充效果 */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background-color: var(--primary-dark);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--bounce);
}
.btn-primary:hover::before { transform: scaleX(1); }
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
}

.btn-outline {
    background-color: transparent;
    color: var(--secondary);
    border: 2px solid #e2e8f0;
}
.btn-outline:hover {
    border-color: var(--secondary);
    background-color: var(--secondary);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.arrow { transition: transform 0.3s var(--bounce); display: inline-block; }
.btn:hover .arrow { transform: translateX(5px); }

/* --- 4. 通用版块 --- */
.section { padding: 120px 0; }
.section-header { text-align: center; margin-bottom: 70px; }
.section-tag {
    text-transform: uppercase;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 15px;
    opacity: 0.8;
}
.section-header h2 {
    font-size: 2.8rem;
    color: var(--secondary);
    font-weight: 800;
    letter-spacing: -0.5px;
}
.section-header p { color: var(--text-light); margin-top: 15px; font-size: 1.1rem; max-width: 600px; margin-left: auto; margin-right: auto;}

/* --- 5. 文档资源 (Documents) - 卡片动效 --- */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 35px;
}

.doc-card {
    background: var(--bg-card);
    padding: 35px 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid #f1f5f9;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    top: 0;
}

.doc-card:hover {
    top: -10px; /* 使用top代替transform防止模糊 */
    box-shadow: var(--shadow-lg);
    border-color: #bfdbfe;
}

.doc-card.featured {
    background: linear-gradient(145deg, #ffffff 0%, #f0f9ff 100%);
    border: 1px solid #dbeafe;
}

.card-icon-wrapper {
    margin-bottom: 25px;
    display: inline-block;
}

.card-icon {
    font-size: 2.2rem;
    background: #f8fafc;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    transition: all 0.4s var(--bounce);
    color: var(--primary);
    border: 1px solid #e2e8f0;
}

/* 卡片悬停时图标动效 */
.doc-card:hover .card-icon {
    background: var(--primary);
    color: white;
    transform: rotate(-10deg) scale(1.1);
    border-color: var(--primary);
    box-shadow: 0 10px 20px -10px rgba(37, 99, 235, 0.5);
}

.doc-card h3 { margin-bottom: 12px; color: var(--secondary); font-size: 1.25rem; }
.doc-card p { color: var(--text-light); font-size: 1rem; margin-bottom: 25px; flex-grow: 1; line-height: 1.6; }

.link-text {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s ease;
}
.small-arrow { transition: transform 0.3s ease; font-size: 1.1rem;}
.doc-card:hover .link-text { gap: 10px; }
.doc-card:hover .small-arrow { transform: translateX(5px); }

/* --- 6. 关于区域 (About) & 数字动画 --- */
.about { background-color: #fff; position: relative; z-index: 1; }
/* 增加一个微妙的背景斜切 */
.about::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom right, #fff 50%, #f8fafc 50%);
    z-index: -1;
    opacity: 0.5;
}

.about-wrapper {
    display: flex;
    align-items: center;
    gap: 80px;
}

.about-image { flex: 1; perspective: 1000px; }

/* 图片揭示动画关键帧 */
@keyframes reveal-image {
    from { -webkit-clip-path: inset(0 100% 0 0); transform: scale(1.1); filter: grayscale(100%); }
    to { -webkit-clip-path: inset(0 0 0 0); transform: scale(1); filter: grayscale(0%); }
}

.img-placeholder {
    width: 100%;
    padding-top: 110%; /* 稍微高一点的比例 */
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: #e2e8f0;
    box-shadow: var(--shadow-md);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}
/* 当元素进入视野时应用揭示动画 */
.about-image.is-visible .reveal-animation img {
    opacity: 1;
    transform: scale(1);
    /* 如果还想保留裁剪效果，在这里添加 */
    clip-path: inset(0 0 0 0);
    -webkit-clip-path: inset(0 0 0 0);
}

.img-placeholder img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    /* 初始状态 */
    opacity: 0; 
    transition: opacity 1s ease, transform 1s ease;
    transform: scale(1.1);
}
/* 无图片时的回退样式 */
.img-placeholder.no-image {
    background: linear-gradient(45deg, #e2e8f0, #cbd5e1);
    display: flex; align-items: center; justify-content: center; color: #94a3b8; font-weight: bold;
}
.img-placeholder.no-image::after { content: 'Image Placeholder'; }

.img-placeholder:hover { transform: scale(1.02) rotateY(2deg); box-shadow: var(--shadow-lg); }

.about-text { flex: 1; }
.about-text h2 { font-size: 2.8rem; color: var(--secondary); margin-bottom: 25px; font-weight: 800;}
.highlight { font-size: 1.2rem; color: var(--primary); font-weight: 600; margin-bottom: 25px; display: block;}

/* 统计数字区域 */
.stats-row {
    display: flex;
    gap: 50px;
    margin-top: 40px;
    padding-top: 35px;
    border-top: 1px solid #f1f5f9;
}
.stat-item { text-align: center; }
.stat-item strong {
    display: block;
    font-size: 3.5rem;
    line-height: 1;
    color: var(--secondary);
    font-weight: 900;
    margin-bottom: 5px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-item span { font-size: 1.5rem; color: var(--primary); font-weight: 700; vertical-align: super;}
.stat-item p { font-size: 0.95rem; color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: 1px;}

/* --- 7. 技能区域 (Skills) & 图标脉冲 --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.skill-card {
    background: #fff;
    padding: 35px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s var(--bounce);
    border: 1px solid transparent;
}
.skill-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: #e2e8f0;
}

.skill-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }

/* 图标微动效 */
@keyframes icon-pop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.skill-card:hover .icon-pulse { animation: icon-pop 0.6s var(--bounce); color: var(--primary); }
.skill-header .icon { font-size: 1.8rem; transition: color 0.3s ease; }

.skill-header h3 { font-size: 1.2rem; color: var(--secondary); font-weight: 700; }

.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tags span {
    font-size: 0.8rem;
    background: #f8fafc;
    color: var(--text-light);
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 600;
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}
.skill-card:hover .tags span { background: #eff6ff; color: var(--primary); border-color: #dbeafe; }

/* --- 8. 联系与页脚 --- */
.contact {
    background: linear-gradient(135deg, var(--secondary) 0%, #1e293b 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}
/* 联系区域背景动效 */
.contact::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(37,99,235,0.1) 0%, transparent 60%);
    animation: pulse-slow 15s infinite linear;
    pointer-events: none;
}

.contact-box { position: relative; z-index: 1; }
.contact-box h2 { margin-bottom: 25px; color: white; font-size: 3rem; }
.contact-box p { color: #cbd5e1; margin-bottom: 40px; max-width: 600px; margin-left: auto; margin-right: auto; font-size: 1.2rem; }

.btn-white {
    background: white;
    color: var(--secondary);
    padding: 16px 40px;
}
.btn-white:hover { background: #f8fafc; transform: translateY(-5px); box-shadow: 0 10px 20px -10px rgba(255,255,255,0.5); }
/* 悬停时轻微弹跳 */
.bounce-hover:hover { animation: float 1s var(--bounce); }

.social-links { margin-top: 50px; display: flex; justify-content: center; gap: 25px; }
.social-link {
    width: 55px;
    height: 55px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.4s var(--bounce);
    color: white;
}
.social-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-5px) rotate(360deg); /* 增加旋转动效 */
    box-shadow: 0 10px 20px -10px rgba(37, 99, 235, 0.8);
}

footer { background: #020617; color: #64748b; padding: 40px 0; font-size: 0.95rem; }
.footer-content { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 30px; }
.footer-links { display: flex; gap: 30px; }
.footer-links a { transition: color 0.3s ease; font-weight: 500; }
.footer-links a:hover { color: var(--primary); }

/* --- 9. 进入动画增强 (Entrance Animations) --- */
/* 基础淡入向上 */
.fade-in { opacity: 0; transform: translateY(30px); animation: fadeInUp 1s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
/* 滚动触发的基础状态 */
.fade-on-scroll { opacity: 0; transform: translateY(40px); transition: all 1s cubic-bezier(0.25, 0.8, 0.25, 1); }
.fade-on-scroll.is-visible { opacity: 1; transform: translateY(0); }

/* 新增：从左侧滑入 */
.fade-on-scroll.from-left { transform: translateX(-60px); }
.fade-on-scroll.from-left.is-visible { transform: translateX(0); }

/* 新增：放大进入 */
.fade-on-scroll.scale-up { transform: scale(0.9); }
.fade-on-scroll.scale-up.is-visible { transform: scale(1); }


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

.delay-1 { animation-delay: 0.2s; transition-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; transition-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; transition-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; transition-delay: 0.8s; }

/* --- 10. 响应式适配 --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.8rem; }
    .hero-bg-shape { width: 400px; height: 400px; top: -10%; right: -20%;}
    .about-wrapper { flex-direction: column; gap: 50px; }
    .stats-row { gap: 30px; justify-content: center; }
    .stat-item strong { font-size: 2.8rem; }
    
    .menu-toggle { display: flex; }
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(255,255,255,0.98);
        flex-direction: column;
        padding: 40px 30px;
        gap: 25px;
        box-shadow: var(--shadow-lg);
        transform: translateY(-150%);
        transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        border-bottom: 1px solid #f1f5f9;
    }
    header.scrolled .nav-links { top: 60px; }
    .nav-links.active { transform: translateY(0); }
    .nav-links a { font-size: 1.1rem; display: block; text-align: center;}
    .nav-links a::after { display: none; } /* 移动端移除下划线动画 */

    .section-header h2 { font-size: 2.2rem; }
    .contact-box h2 { font-size: 2.2rem; }
    
    .footer-content { flex-direction: column; gap: 20px; text-align: center; }

    .about-image {
        width: 100%;       /* 强制占据整行宽度 */
        max-width: 500px;  /* 防止在平板上图片过大 */
        margin: 0 auto;    /* 居中显示 */
        display: block;    /* 确保作为块级元素存在 */
    }

    .img-placeholder {
        width: 100%;       /* 确保占位符撑开 */
    }
}

/* --- 微信二维码弹窗样式 --- */

/* 1. 确保父元素相对定位，以便子元素绝对定位 */
.social-link {
    position: relative; 
    /* 之前的样式保持不变... */
}

/* 2. 弹窗容器 */
.qr-popup {
    position: absolute;
    bottom: 140%; /* 位于图标上方，留出一点距离 */
    left: 50%;
    transform: translateX(-50%) scale(0.5); /* 初始状态：居中、缩小 */
    transform-origin: bottom center; /* 动画原点设为底部中心 */
    
    width: 160px; /* 弹窗宽度 */
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); /* 深色阴影增加层次感 */
    
    opacity: 0;
    visibility: hidden; /* 隐藏 */
    pointer-events: none; /* 隐藏时不阻挡鼠标交互 */
    
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* 弹性动画曲线 */
    z-index: 100;
}

/* 3. 弹窗内的小箭头 (指向下方) */
.qr-popup::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0; /* 倒三角 */
    border-style: solid;
    border-color: white transparent transparent transparent;
}

/* 4. 二维码图片样式 */
.qr-popup img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    margin-bottom: 8px;
}

/* 5. 底部文字样式 */
.qr-popup span {
    display: block;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 5px;
}

/* 6. 鼠标悬停交互 (Hover Effect) */
.social-link:hover .qr-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1); /* 恢复正常大小 */
    bottom: 130%; /* 稍微有一点位移的视觉反馈 */
}