  /* 全局样式 */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 导航栏样式 */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

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

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #3498db;
}

/* 搜索栏样式 */
.search-bar {
    display: flex;
    margin: 2rem auto;
    max-width: 600px;
}

.search-bar input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}

.search-bar button {
    padding: 0.8rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-bar button:hover {
    background-color: #2980b9;
}

/* 轮播图样式 */
.carousel-container {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    margin: 3rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.carousel-slide {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.slide-item {
    min-width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
}

.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    /* background: rgba(0, 0, 0, 0.7); */
    color: white;
    padding: 1rem;
    /* transform: translateX(8%); */
    /* transform: translateY(5%); */
}

.slide-info h3 {
    margin-bottom: 0.5rem;
}

/* 修改轮播按钮样式 - 只显示图标 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: white;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.carousel-btn:hover {
    opacity: 1;
}

#prevBtn {
    left: 20px;
}

#nextBtn {
    right: 20px;
}

.carousel-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    z-index: 10;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    margin: 0 5px;
    cursor: pointer;
}

.nav-dot.active {
    background: white;
}

/* 图片放大预览样式 */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 3rem;
    cursor: pointer;
}

/* 自我介绍部分 */
.about-me {
    background-color: white;
    padding: 3rem 0;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.about-me h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.profile-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #3498db;
}

.bio {
    flex: 1;
}

.bio h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.bio p {
    margin-bottom: 1rem;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.skill {
    background-color: #3498db;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* 作品展示部分 - 图片加大 */
.portfolio {
    background-color: white;
    padding: 3rem 0;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.portfolio h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

/* 作品分类导航 */
.portfolio-categories {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-btn {
    padding: 0.5rem 1.5rem;
    background-color: #f5f5f5;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-btn.active {
    background-color: #3498db;
    color: white;
}

.category-btn:hover {
    background-color: #ddd;
}

.category-btn.active:hover {
    background-color: #2980b9;
}

/* 作品展示区 - 图片加大 */
.works-container {
    display: none;
}

.works-container.active {
    display: block;
}

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

.work-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    cursor: pointer;
}

.work-item:hover {
    transform: translateY(-5px);
}

.work-img {
    width: 100%;
    height: 350px; /* 图片高度加大 */
    object-fit: cover;
}

.work-info {
    padding: 1.5rem;
    background: white;
}

.work-info h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

/* 联系方式部分 */
.contact {
    background-color: white;
    padding: 3rem 0;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.contact h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.contact-methods {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
}

.contact-method {
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.contact-method i {
    font-size: 2rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.contact-method h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

/* 页脚样式 */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        margin-top: 1rem;
    }
    
    .nav-links li {
        margin-left: 1rem;
        margin-right: 1rem;
    }
    
    .about-content {
        flex-direction: column;
        text-align: center;
    }
    
    .skills {
        justify-content: center;
    }
    
    .carousel-container {
        height: 350px;
    }
    
    .portfolio-categories {
        flex-direction: column;
        align-items: center;
    }
    
    .works-grid {
        grid-template-columns: 1fr;
    }
    
    .work-img {
        height: 250px; /* 移动端适当减小高度 */
    }
}
