/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-text: #777;
    --bg-color: #fff;
    --light-bg: #f9f9f9;
    --border-color: #ddd;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

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

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 15px;
    font-weight: 600;
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.8rem;
}

p {
    margin-bottom: 20px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 10px 0;
    background-color: white;
}

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

.navbar .logo h1 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

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

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

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: var(--transition);
    background-color: var(--text-color);
}

/* 首页样式 */
.home {
    height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://picsum.photos/id/1053/1920/1080');
    background-size: cover;
    background-position: center;
    color: white;
}

.home-content {
    max-width: 600px;
}

.home-content h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.home-content h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

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

.social-links {
    display: flex;
    margin-bottom: 30px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
}

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

/* 关于我样式 */
.about {
    padding: 100px 0;
    background-color: var(--light-bg);
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
}

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

.about-img {
    flex: 0 0 350px;
    margin-bottom: 30px;
}

.about-img img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.about-text {
    flex: 0 0 calc(100% - 400px);
}

.about-text h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.personal-info {
    margin-top: 30px;
}

.info-item {
    display: flex;
    margin-bottom: 15px;
}

.info-item span:first-child {
    width: 100px;
    font-weight: 500;
    color: var(--secondary-color);
}

/* 技能样式 */
.skills {
    padding: 100px 0;
}

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

.skill-item {
    margin-bottom: 30px;
}

.skill-name {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 500;
}

.skill-bar {
    width: 100%;
    height: 10px;
    background-color: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 5px;
    transition: width 1.5s ease;
}

.skill-percentage {
    font-weight: 500;
    color: var(--primary-color);
}

/* 作品样式 */
.projects {
    padding: 100px 0;
    background-color: var(--light-bg);
}

.projects-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.project-item {
    flex: 0 0 calc(33.333% - 30px);
    margin-bottom: 30px;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.project-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

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

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

.project-item:hover .project-img img {
    transform: scale(1.1);
}

.project-info {
    padding: 20px;
}

.project-info h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.project-links {
    margin-top: 20px;
}

/* 联系方式样式 */
.contact {
    padding: 100px 0;
}

.contact-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.contact-info {
    flex: 0 0 400px;
    margin-bottom: 30px;
}

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

.contact-item i {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    margin-right: 20px;
    font-size: 1.2rem;
}

.contact-form {
    flex: 0 0 calc(100% - 450px);
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 页脚样式 */
.footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 40px 0;
}

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

.footer .social-links {
    margin-bottom: 0;
}

.footer .social-links a {
    background-color: rgba(255, 255, 255, 0.1);
}

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

/* 响应式设计 */
@media (max-width: 992px) {
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .home-content h1 {
        font-size: 3rem;
    }
    
    .about-img,
    .about-text {
        flex: 0 0 100%;
    }
    
    .about-text {
        margin-top: 30px;
    }
    
    .project-item {
        flex: 0 0 calc(50% - 30px);
    }
    
    .contact-info,
    .contact-form {
        flex: 0 0 100%;
    }
    
    .contact-form {
        margin-top: 30px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-links li {
        margin: 2.5rem 0;
    }
    
    .hamburger {
        display: block;
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .project-item {
        flex: 0 0 100%;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer .social-links {
        margin-top: 20px;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .home-content h1 {
        font-size: 2.5rem;
    }
    
    .home-content h2 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 25px;
    }
}