/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

/* 排版优化 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: #2c3e50;
}

h1 {
    font-size: 3.5rem;
    background: linear-gradient(to right, #4CAF50, #8BC34A);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

p {
    margin-bottom: 20px;
    color: #555;
    font-size: 1.05rem;
}

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

/* 导航样式 */
header {
    background-color: #333;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 20px 0;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 20px 10px;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

nav ul li a:hover {
    color: #4CAF50;
    border-bottom: 2px solid #4CAF50;
}

/* 英雄区域样式 */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #434343 100%);
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(76, 175, 80, 0.1) 0%, transparent 70%);
    animation: pulse 6s ease-in-out infinite;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    background-color: #4CAF50;
    color: #fff;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #45a049;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
    z-index: -1;
}

.btn:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* 关于我区域样式 */
.about-section {
    padding: 100px 0;
    background-color: #fff;
}

.about-section h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
}

.about-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.profile-img {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 30px;
}

.img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ddd;
    color: #666;
    font-size: 1.2rem;
}

.bio {
    flex: 1;
    min-width: 300px;
    padding: 0 30px;
}

.bio h3 {
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.bio p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* 技能部分样式 */
.skills-section {
    padding: 100px 0;
    background-color: #fff;
}

.skills-section h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.skill-card {
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.skill-card h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: #4CAF50;
    text-align: center;
}

.skill-card ul {
    list-style: none;
}

.skill-card ul li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.skill-card ul li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
}

/* 项目区域样式 */
.projects-section {
    padding: 100px 0;
    background-color: #f9f9f9;
}

.projects-section h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.project-img {
    height: 200px;
    overflow: hidden;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.05);
}

.project-info {
    padding: 20px;
}

.project-info h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.project-link {
    display: inline-block;
    color: #4CAF50;
    text-decoration: none;
    margin-top: 15px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: #45a049;
    text-decoration: underline;
}

/* 联系方式样式 */
.contact-section {
    padding: 100px 0;
    background-color: #fff;
}

.contact-section h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
}

.contact-info {
    text-align: center;
}

.contact-info p {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.social-links {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: #4CAF50;
    transform: translateY(-3px);
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: #fff;
    padding: 40px 0 20px;
    text-align: center;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
}

/* 响应式设计 */
/* 平板设备 */
@media (max-width: 992px) {
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .about-content {
        flex-direction: column;
        text-align: center;
    }
    
    .bio {
        padding: 30px 0 0 0;
    }
    
    .profile-img {
        margin-bottom: 0;
    }
}

/* 平板和手机设备 */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    nav ul {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul li {
        margin: 0;
    }
    
    nav ul li a {
        padding: 10px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .about-section, .projects-section, .contact-section {
        padding: 80px 0;
    }
}

/* 手机设备 */
@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .about-section h2, .projects-section h2, .contact-section h2 {
        font-size: 2rem;
    }
    
    .bio h3 {
        font-size: 1.5rem;
    }
    
    .profile-img {
        width: 250px;
        height: 250px;
    }
    
    .about-section, .projects-section, .contact-section {
        padding: 60px 0;
    }
}

/* 确保页面内容不被固定导航栏遮挡 */
section {
    scroll-margin-top: 70px;
    position: relative;
}

/* 添加平滑过渡效果 */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* 为移动设备添加触摸反馈 */
@media (hover: none) and (pointer: coarse) {
    .btn:active {
        background-color: #3e8e41;
        transform: translateY(0);
    }
    
    nav ul li a:active {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .project-card:active, .skill-card:active {
        transform: translateY(0);
    }
}

/* 动画定义 */
@keyframes pulse {
    0% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
    100% {
        opacity: 0.4;
        transform: scale(1);
    }
}

/* 添加入场动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.about-content, .skills-grid, .projects-grid, .contact-info {
    animation: fadeInUp 1s ease-out;
}