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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    position: relative;
}

/* 返回按钮样式 */
.back-button {
    position: absolute;
    top: 20px;
    left: 40px;
    padding: 10px 20px;
    background-color: #8BC34A;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    opacity: 0;
    transform: translateX(-20px);
    animation: fadeIn 0.5s ease-out forwards 0.2s;
}

.back-button:hover {
    background-color: #7CB342;
    transform: translateX(-10px) scale(1.05);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.container {
    max-width: 1200px;
    width: 100%;
    padding: 20px;
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: flex-start;
}

.profile-card {
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 40px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* 左侧卡片样式 */
.left-card {
    width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: scrollFadeIn 0.6s ease-out forwards;
}

/* 右侧卡片样式 */
.right-card {
    width: 500px;
    max-width: 500px;
    text-align: left;
    animation: scrollFadeIn 0.8s ease-out forwards;
}

/* 关于我区域样式 */
.about {
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(20px);
    animation: scrollFadeIn 0.6s ease-out forwards 0.5s;
}

.section-title {
    font-size: 20px;
    color: #444;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f5f5f5;
}

.about-text {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 12px;
}

/* 技能区域样式 */
.skills {
    margin-top: 30px;
    opacity: 0;
    transform: translateY(20px);
    animation: scrollFadeIn 0.6s ease-out forwards 0.7s;
}

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

.skill-name {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
}

.skill-bar {
    width: 100%;
    height: 12px;
    background-color: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background-color: #8BC34A;
    border-radius: 6px;
    transition: width 1s ease-in-out;
    animation: skillProgress 1.5s ease-out forwards;
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
    border: 5px solid #f0f0f0;
    animation: pulse 3s infinite;
}

.avatar:hover {
    animation: pulse 1.5s infinite;
}

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

.title {
    font-size: 28px;
    color: #444;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    border-right: 3px solid #8BC34A;
    animation: typing 1s steps(4, end), blink-caret 0.75s step-end infinite;
}

.subtitle {
    font-size: 18px;
    color: #777;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    animation: scrollFadeIn 0.5s ease-out forwards 0.3s;
}

#contact-menu-btn {
    padding: 12px 30px;
    background-color: #8BC34A;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#contact-menu-btn:hover {
    background-color: #7CB342;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* 新添加的动效 */
/* 技能条动画 */
@keyframes skillProgress {
    from {
        width: 0%;
    }
    to {
        width: var(--skill-width, 100%);
    }
}

/* 头像呼吸动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(139, 195, 74, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(139, 195, 74, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(139, 195, 74, 0);
    }
}

/* 打字机效果 */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #8BC34A;
    }
}

/* 滚动淡入效果 */
@keyframes scrollFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 模态框弹性动画 */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
    50% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1.05);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 模态框遮罩层 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    transition: opacity 0.3s ease;
}

/* 模态框显示状态 */
.modal-overlay.show {
    opacity: 1;
}

/* 模态框隐藏状态 */
.modal-overlay.hide {
    opacity: 0;
}

/* 联系方式弹窗 */
.contact-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 400px;
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    display: none;
    transform: translate(-50%, -50%);
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* 弹窗显示状态 */
.contact-modal.show {
    animation: bounceIn 0.5s ease-out;
}

/* 弹窗隐藏状态 */
.contact-modal.hide {
    animation: slideOut 0.3s ease-in;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-overlay.hide {
    opacity: 0;
}

/* 联系方式弹窗 */
.contact-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 400px;
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    display: none;
    transform: translate(-50%, -50%);
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* 弹窗显示状态 */
.contact-modal.show {
    animation: bounceIn 0.5s ease-out;
}

/* 弹窗隐藏状态 */
.contact-modal.hide {
    animation: slideOut 0.3s ease-in;
}

/* 滚动渐入动画类 - 可用于任何元素 */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 弹窗头部 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background-color: #fafafa;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

/* 关闭按钮 */
.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* 弹窗内容 */
.modal-content {
    padding: 20px;
}

.modal-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-content li {
    margin-bottom: 10px;
}

.modal-content li:last-child {
    margin-bottom: 0;
}

.modal-content a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 16px;
}

.modal-content a:hover {
    background-color: #f5f5f5;
    transform: translateX(5px);
}

/* 图标样式 */
.icon {
    margin-right: 12px;
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
    margin-top: 5px;
    min-width: 120px;
    display: none;
    z-index: 1000;
}

.menu.show {
    display: block;
}

.menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu li {
    padding: 0;
}

.menu a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.menu a:hover {
    background-color: #f5f5f5;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        align-items: center;
    }
    
    .left-card,
    .right-card {
        width: 100%;
        max-width: 500px;
    }
    
    .profile-card {
        padding: 30px 20px;
    }
    
    .title {
        font-size: 24px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .about-text {
        font-size: 15px;
    }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #e0e0e0;
    }
    
    .profile-card {
        background-color: #1e1e1e;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .section-title {
        color: #f5f5f5;
        border-bottom-color: #333;
    }
    
    .about-text,
    .skill-name {
        color: #b0b0b0;
    }
    
    .skill-bar {
        background-color: #333;
    }
    
    .back-button {
        background-color: #689F38;
    }
    
    .back-button:hover {
        background-color: #558B2F;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .contact-modal {
        background-color: #1e1e1e;
        color: #e0e0e0;
    }
    
    .modal-overlay {
        background-color: rgba(0, 0, 0, 0.7);
    }
    
    /* 联系菜单按钮深色模式样式 */
    #contact-menu-btn {
        background-color: #689F38;
        color: white;
    }
    
    #contact-menu-btn:hover {
        background-color: #558B2F;
    }
    
    /* 弹窗内容区域深色模式样式 */
    .modal-content a {
        color: #e0e0e0;
        background-color: transparent;
    }
    
    .modal-content a:hover {
        background-color: #2d2d2d;
    }
    
    /* 弹窗头部深色模式样式 */
    .modal-header {
        border-bottom-color: #333;
        background-color: #2d2d2d;
    }
    
    .modal-header h3 {
        color: #f5f5f5;
    }
    
    .close-btn {
        color: #999;
    }
    
    .close-btn:hover {
        background-color: #333;
        color: #e0e0e0;
    }
}