* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    transition: all 0.5s ease;
    min-height: 100vh;
}

/* 背景样式 */
.bg-white {
    background-color: #ffffff;
    color: #333333;
}

.bg-black {
    background-color: #000000;
    color: #ffffff;
}

.bg-silver {
    background: linear-gradient(135deg, #f0f0f0 0%, #c0c0c0 50%, #a0a0a0 100%);
    color: #333333;
}

.bg-star {
    background-color: #000000;
    color: #ffffff;
    position: relative;
    overflow: auto;
}

.bg-star::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 90px 40px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 130px 80px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 160px 120px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 200px 150px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 240px 180px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 280px 210px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 320px 240px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 360px 270px, #fff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 400px 400px;
    animation: twinkle 3s infinite;
}

/* 流星容器 */
.meteors {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    display: none;
}

/* 仅在星空背景下显示流星 */
.bg-star .meteors {
    display: block;
}

/* 流星样式 - 明显的圆形 */
.meteor {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #ffffff;
    border-radius: 50%; /* 确保元素是圆形 */
    box-shadow: 
        0 0 5px rgba(255, 255, 255, 1),
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 15px rgba(255, 255, 255, 0.6);
    opacity: 0;
}

/* 流星拖尾 - 使用伪元素 */
.meteor::after {
    content: '';
    position: absolute;
    right: 4px;
    top: 4px;
    width: 150px;
    height: 2px;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(145deg);
    transform-origin: right center;
}

/* 流星初始位置 - 垂直分布，水平方向在屏幕外 */
.meteor-1 {
    top: 10%;
    left: calc(100vw + 200px);
}

.meteor-2 {
    top: 20%;
    left: calc(100vw + 200px);
}

.meteor-3 {
    top: 30%;
    left: calc(100vw + 200px);
}

.meteor-4 {
    top: 40%;
    left: calc(100vw + 200px);
}

.meteor-5 {
    top: 50%;
    left: calc(100vw + 200px);
}

.meteor-6 {
    top: 60%;
    left: calc(100vw + 200px);
}

.meteor-7 {
    top: 70%;
    left: calc(100vw + 200px);
}

.meteor-8 {
    top: 80%;
    left: calc(100vw + 200px);
}

.meteor-9 {
    top: 90%;
    left: calc(100vw + 200px);
}

.meteor-10 {
    top: 100%;
    left: calc(100vw + 200px);
}

/* 手动触发动画的类 */
.meteor.fly {
    animation-name: meteor-fly;
    animation-duration: 4s;
    animation-timing-function: linear;
    animation-iteration-count: 1; /* 只执行一次 */
    animation-fill-mode: forwards; /* 保持最终状态 */
}

/* 流星飞行动画 - 与水平方向呈45°角从右上到左下 */
@keyframes meteor-fly {
    0% {
        left: calc(100vw + 200px);
        top: -200px;
        opacity: 0;
        transform: scale(0.8);
    }
    10% {
        opacity: 1;
        transform: scale(1);
    }
    20% {
        opacity: 0.5;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
    40% {
        opacity: 0.5;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    60% {
        opacity: 0.5;
        transform: scale(0.8);
    }
    70% {
        opacity: 1;
        transform: scale(1);
    }
    80% {
        opacity: 0.5;
        transform: scale(0.8);
    }
    90% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        /* 保持结束状态，动画在30%时就基本完成 */
        left: -200px;
        top: calc(100vh + 200px);
        opacity: 0;
        transform: scale(0.8);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

.bg-colorful {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7, #dfe6e9);
    background-size: 600% 600%;
    color: #333333;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 背景切换按钮 */
.background-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

/* 切换按钮样式 */
.bg-toggle-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1001;
}

.bg-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.bg-toggle-btn .icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

/* 下拉菜单样式 */
.bg-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    min-width: 120px;
}

/* 下拉菜单显示状态 */
.background-switcher.active .bg-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 下拉菜单动画效果 - 子元素依次弹出 */
.background-switcher.active .bg-btn {
    animation: dropdownItemSlide 0.4s ease forwards;
    opacity: 0;
    transform: translateY(-10px);
}

.background-switcher.active .bg-btn:nth-child(1) {
    animation-delay: 0.1s;
}

.background-switcher.active .bg-btn:nth-child(2) {
    animation-delay: 0.15s;
}

.background-switcher.active .bg-btn:nth-child(3) {
    animation-delay: 0.2s;
}

.background-switcher.active .bg-btn:nth-child(4) {
    animation-delay: 0.25s;
}

.background-switcher.active .bg-btn:nth-child(5) {
    animation-delay: 0.3s;
}

@keyframes dropdownItemSlide {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 背景按钮样式 */
.bg-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    text-align: left;
}

.bg-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bg-btn.active {
    background-color: #333;
    color: #fff;
}

/* 黑色背景下的按钮样式 */
.bg-black .bg-toggle-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.bg-black .bg-dropdown {
    background-color: rgba(0, 0, 0, 0.9);
}

.bg-black .bg-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.bg-black .bg-btn.active {
    background-color: #fff;
    color: #333;
}

/* 容器样式 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
}

.profile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.avatar img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.info {
    text-align: center;
}

.info h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

.info p {
    font-size: 1.2em;
    margin-bottom: 5px;
}

.contact-info {
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 0.95em;
}

.contact-info p {
    margin: 5px 0;
    font-size: 1em;
    opacity: 0.9;
}

.skills {
    margin-bottom: 40px;
    text-align: center;
}



.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.skills-list span {
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.skills-list span:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.experience {
    margin-bottom: 40px;
    text-align: center;
}



.experience ul {
    list-style: none;
    display: inline-block;
    text-align: left;
}

.experience li {
    margin-bottom: 15px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.experience li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

/* Scroll animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animations for list items */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Delay classes for staggered animations */
.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}

.delay-5 {
    transition-delay: 0.5s;
}

.delay-6 {
    transition-delay: 0.6s;
}

/* Skill item animations */
.skills-list span {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.skills-list span.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Section heading animations */
h3 {
    font-size: 1.8em;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    text-align: center;
}

section.visible h3 {
    opacity: 1;
    transform: translateY(0);
}

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Additional styling for new sections */
.education,
.projects,
.advantages {
    margin-bottom: 40px;
    text-align: center;
}



.education ul,
.projects ul,
.advantages ul {
    list-style: none;
    display: inline-block;
    text-align: left;
}

.education li,
.projects li,
.advantages li {
    margin-bottom: 15px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.education li:hover,
.projects li:hover,
.advantages li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Profile section animation */
.profile .avatar,
.profile .info {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.profile .avatar {
    transform: translateX(-30px);
}

.profile .info {
    transform: translateX(30px);
}

.profile.visible .avatar,
.profile.visible .info {
    opacity: 1;
    transform: translateX(0);
}

/* Header animation */
header h1 {
    opacity: 0;
    transform: translateY(-30px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

header.visible h1 {
    opacity: 1;
    transform: translateY(0);
}



/* Improve list item spacing */
.experience li p,
.projects li p {
    margin: 5px 0;
    font-size: 0.95em;
    opacity: 0.9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .background-switcher {
        flex-direction: column;
        top: 10px;
        right: 10px;
    }
    
    .profile {
        flex-direction: column;
        gap: 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .info h2 {
        font-size: 1.5em;
    }
    
    .skills h3, .experience h3, .education h3, .projects h3 {
        font-size: 1.5em;
    }
    
    /* Adjust animations for mobile */
    .fade-in {
        transform: translateY(20px);
    }
    
    .profile .avatar,
    .profile .info {
        transform: translateY(20px);
    }
}