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

:root {
    --primary-color: #4a6fa5;
    --secondary-color: #6d8baf;
    --highlight-color: #e67e22;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --gray-color: #95a5a6;
    --white-color: #ffffff;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f7fa;
}

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

.section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.highlight {
    color: var(--highlight-color);
}

.separator {
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 0 auto 20px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: var(--white-color);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.primary-btn {
    background-color: var(--primary-color);
}

.secondary-btn {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    margin-left: 15px;
}

.secondary-btn:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: var(--transition);
    background-color: transparent;
}

.navbar.scrolled {
    background-color: var(--white-color);
    padding: 10px 0;
    box-shadow: var(--shadow);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--white-color);
    transition: var(--transition);
}

.navbar.scrolled .logo {
    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(--white-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.navbar.scrolled .nav-links a {
    color: var(--dark-color);
}

.nav-links a:hover {
    color: var(--highlight-color);
}

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

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

.menu-toggle {
    display: none;
    color: var(--white-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.navbar.scrolled .menu-toggle {
    color: var(--dark-color);
}

/* 英雄区域样式 */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(rgba(74, 111, 165, 0.8), rgba(74, 111, 165, 0.9)), url('images/banner.jpg') center/cover no-repeat;
    color: var(--white-color);
    position: relative;
}

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

.hero-content {
    flex: 1;
    padding-right: 50px;
}

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

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
}

.hero-image {
    flex: 0 0 400px;
}

.profile-img {
    width: 100%;
    border-radius: 50%;
    border: 8px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.profile-img:hover {
    transform: scale(1.05) rotate(5deg);
}

/* 关于我样式 */
.about {
    background-color: var(--white-color);
}

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

.about-text {
    flex: 1;
    min-width: 300px;
    padding-right: 50px;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.about-stats {
    flex: 1;
    min-width: 300px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.stat-box {
    background-color: var(--light-color);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-box:hover {
    transform: translateY(-10px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-title {
    font-size: 1rem;
    color: var(--gray-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 技能样式 */
.skills {
    background-color: var(--light-color);
}

.skills-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.skill-category {
    flex: 1;
    min-width: 300px;
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 10px;
}

.skill-category h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--highlight-color);
}

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

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

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

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

/* 项目样式 */
.projects {
    background-color: var(--white-color);
}

.project-filters {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 8px 20px;
    background-color: var(--light-color);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.filter-btn:hover:not(.active) {
    background-color: #e0e0e0;
}

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

.project-card {
    background-color: var(--light-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: block;
    opacity: 1;
    transform: scale(1);
}

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

.project-img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

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

.project-info {
    padding: 20px;
}

.project-info h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.project-info p {
    color: var(--gray-color);
    font-size: 0.95rem;
}

/* 联系样式 */
.contact {
    background-color: var(--light-color);
}

.contact-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

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

.contact-icon {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--white-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
}

.contact-icon i {
    font-size: 1.2rem;
}

.contact-details h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--dark-color);
}

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

.contact-map {
    flex: 1;
    min-width: 300px;
}

.map-img {
    width: 100%;
    border-radius: 10px;
    box-shadow: var(--shadow);
    height: 400px;
    object-fit: cover;
}

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

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

.footer-logo {
    flex: 1;
    min-width: 300px;
}

.footer-logo .logo {
    color: var(--white-color);
    margin-bottom: 10px;
    display: inline-block;
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.7);
    max-width: 400px;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-icon:hover {
    background-color: var(--highlight-color);
    transform: translateY(-5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--white-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--highlight-color);
    transform: translateY(-5px);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.8rem;
    }
    
    .hero .container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content {
        padding-right: 0;
        margin-bottom: 40px;
    }
    
    .hero-buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .secondary-btn {
        margin-left: 0;
        margin-top: 15px;
        width: 100%;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .about-text {
        padding-right: 0;
        margin-bottom: 40px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background-color: var(--white-color);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        margin: 20px 0;
        margin-left: 0;
    }
    
    .nav-links a {
        color: var(--dark-color);
        font-size: 1.2rem;
    }
    
    .menu-toggle {
        display: block;
        z-index: 1001;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .project-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-social {
        margin-top: 20px;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
    }
    
    .skill-category {
        min-width: 100%;
    }
    
    .contact-content {
        flex-direction: column;
    }
    
    .section {
        padding: 80px 0;
    }
}
