/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}
/* 移动端菜单样式 */
.mobile-menu {
    display: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 5px;
}
/* 导航栏样式 */
nav {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
.logo {
    font-size: 1.8rem;
    font-weight: 700;
}
.nav-links {
    display: flex;
    list-style: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.nav-links.active {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 78px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    padding: 1rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: none;
    z-index: 101;
}
.nav-links li {
    margin-left: 2rem;
    position: relative;
}
.nav-links.active li {
    margin: 0;
    text-align: left;
    padding-left: 2rem;
}
.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
    padding: 0.5rem 0;
    display: block;
    font-size: 1rem;
}
.nav-links.active a {
    padding: 0.75rem 2rem;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    font-size: 1rem;
}
.nav-links a:hover {
    opacity: 0.8;
}
.nav-links.active a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
/* 下拉菜单样式 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    list-style: none;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-menu li {
    margin: 0;
}
.dropdown-menu a {
    color: #333;
    padding: 0.75rem 1.5rem;
    display: block;
    transition: background-color 0.2s;
}
.dropdown-menu a:hover {
    background-color: #f5f5f5;
    opacity: 1;
}
/* 弹窗卡片样式 */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}
.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}
.popup-card {
    background-color: white;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.4s ease;
    overflow: visible;
    display: flex;
    flex-direction: column;
}
.popup-overlay.active .popup-card {
    transform: translateY(0);
}
.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #333;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.popup-close:hover {
    background-color: white;
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}
.popup-img-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: visible;
}
.popup-img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px 12px 0 0;
}
.popup-content {
    padding: 25px;
    text-align: center;
    flex: 0 0 auto;
}
.popup-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 22px;
}
.popup-content p {
    margin-bottom: 10px;
    color: #555;
    line-height: 1.5;
}
.popup-content small {
    color: #888;
    font-size: 14px;
}
/* 主内容区域 */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}
/* 个人信息区域 */
.profile {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 100px;
}
.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem;
    display: block;
    border: 5px solid #f0f0f0;
}
.profile h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}
.profile-title {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 1.5rem;
    font-weight: 500;
}
.profile p {
    margin-bottom: 1.5rem;
    color: #555;
}
.contact-info {
    margin-top: 1.5rem;
}
.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
}
.contact-item i {
    margin-right: 10px;
    color: #6a11cb;
    width: 20px;
}
/* 作品展示区域 */
.works {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
.category {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.category h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
    color: #2c3e50;
}
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.work-item {
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
}
.work-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.work-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}
.work-img-h {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}
.work-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.work-content h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}
.work-content p {
    color: #7f8c8d;
    font-size: 0.9rem;
    flex-grow: 1;
    margin-bottom: 1rem;
}
.work-link {
    display: inline-block;
    background: #6a11cb;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s;
    align-self: flex-start;
}
.work-link:hover {
    background: #2575fc;
}
/* 响应式设计 */
@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
    }
    .profile {
        position: static;
    }
    .nav-links.active {
        top: 78px;
    }
    .nav-links {
        display: none;
    }
    .mobile-menu {
        display: block;
        font-size: 1.4rem;
        cursor: pointer;
    }
}
@media (max-width: 600px) {
    .work-grid {
        grid-template-columns: 1fr;
    }
}
/* 弹出卡片的响应式调整 */
@media (max-width: 768px) {
    .popup-card {
        max-width: 90%;
    }
    .popup-img {
        max-height: 60vh;
    }
    .popup-content {
        padding: 20px;
    }
    .popup-content h3 {
        font-size: 20px;
    }
}
@media (max-width: 480px) {
    .popup-card {
        max-width: 95%;
    }
    .popup-img {
        max-height: 50vh;
    }
    .popup-content {
        padding: 15px;
    }
}