/* 全局样式 */
:root {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --secondary: #10B981;
    --dark: #1F2937;
    --light: #F9FAFB;
    --gray: #6B7280;
    --gray-light: #E5E7EB;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #f8fafc;
}

a {
    text-decoration: none;
    color: inherit;
}

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

section {
    padding: 60px 0;
}

h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary);
    color: white;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* 头部样式 */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

/* 英雄区域 */
.hero {
    padding: 100px 0;
    text-align: center;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

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

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.hero p.subtitle {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 20px;
}

.hero-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.hero-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray);
}

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

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-3px);
}

/* 关于部分 */
.about {
    background-color: white;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-text p {
    margin-bottom: 15px;
    color: var(--gray);
}

.about-image {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 技能部分 */
.skills {
    background-color: #f8fafc;
}

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

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

.skill-card:hover {
    transform: translateY(-5px);
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.skill-card h3 {
    margin-bottom: 15px;
}

.skill-card p {
    color: var(--gray);
}

/* 项目部分 */
.projects {
    background-color: white;
}

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

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

.project-card:hover {
    transform: translateY(-5px);
}

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

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

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

.project-content {
    padding: 20px;
    background-color: white;
}

.project-content h3 {
    margin-bottom: 10px;
}

.project-content p {
    color: var(--gray);
    margin-bottom: 15px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.project-tag {
    background-color: var(--gray-light);
    color: var(--dark);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-links a {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    color: var(--primary);
}

.project-links a:hover {
    text-decoration: underline;
}

/* 联系部分 */
.contact {
    background-color: #f8fafc;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-info h3 {
    margin-bottom: 20px;
}

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

.contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.2rem;
}

.contact-text h4 {
    margin-bottom: 5px;
}

.contact-text p {
    color: var(--gray);
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--gray-light);
    border-radius: 5px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.contact-form textarea {
    min-height: 120px;
    resize: vertical;
}

/* 页脚 */
footer {
    background-color: var(--dark);
    color: white;
    text-align: center;
    padding: 30px 0;
}

.footer-content p {
    margin-bottom: 15px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .about-content,
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    .about-image {
        order: -1;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: white;
        flex-direction: column;
        align-items: center;
        padding: 40px 0;
        transition: left 0.3s ease;
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .hamburger {
        display: block;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    section {
        padding: 40px 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p.subtitle {
        font-size: 1rem;
    }
}