/* Intro Animation */
.intro-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: introFadeOut 2.5s ease-in-out forwards;
}

.intro-text {
    font-size: 5rem;
    font-weight: bold;
    display: flex;
    justify-content: center;
    opacity: 1;
    margin-bottom: 1.5rem;
}

.loading-bar {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.loading-bar span {
    font-size: 2rem;
    opacity: 0;
    transform: scale(0.5);
    filter: blur(2px);
    animation: emojiLoad 0.3s ease-out forwards;
}

.loading-bar span:nth-child(1) { animation-delay: 0.1s; }
.loading-bar span:nth-child(2) { animation-delay: 0.2s; }
.loading-bar span:nth-child(3) { animation-delay: 0.3s; }
.loading-bar span:nth-child(4) { animation-delay: 0.4s; }
.loading-bar span:nth-child(5) { animation-delay: 0.5s; }
.loading-bar span:nth-child(6) { animation-delay: 0.6s; }
.loading-bar span:nth-child(7) { animation-delay: 0.7s; }
.loading-bar span:nth-child(8) { animation-delay: 0.8s; }

@keyframes emojiLoad {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(10px);
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

/* 添加消失动画 */
.loading-bar span {
    animation:
        emojiLoad 0.3s ease-out forwards,
        emojiUnload 0.3s ease-in forwards;
}

.loading-bar span:nth-child(1) { animation-delay: 0.1s, 1.6s; }
.loading-bar span:nth-child(2) { animation-delay: 0.2s, 1.7s; }
.loading-bar span:nth-child(3) { animation-delay: 0.3s, 1.8s; }
.loading-bar span:nth-child(4) { animation-delay: 0.4s, 1.9s; }
.loading-bar span:nth-child(5) { animation-delay: 0.5s, 2.0s; }
.loading-bar span:nth-child(6) { animation-delay: 0.6s, 2.1s; }
.loading-bar span:nth-child(7) { animation-delay: 0.7s, 2.2s; }
.loading-bar span:nth-child(8) { animation-delay: 0.8s, 2.3s; }

@keyframes emojiUnload {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
        filter: blur(2px);
    }
}

.intro-text span {
    background: linear-gradient(135deg, #333, #666);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transform: scale(0.5);
    display: inline-block;
    animation: textReveal 0.5s ease-out forwards,
               textGlow 2s ease-in-out infinite;
}

.intro-text span:nth-child(1) { animation-delay: 0.1s, 0.1s, 1.6s; }
.intro-text span:nth-child(2) { animation-delay: 0.2s, 0.2s, 1.7s; }
.intro-text span:nth-child(3) { animation-delay: 0.3s, 0.3s, 1.8s; }
.intro-text span:nth-child(4) { animation-delay: 0.4s, 0.4s, 1.9s; }
.intro-text span:nth-child(5) { animation-delay: 0.5s, 0.5s, 2.0s; }
.intro-text span:nth-child(6) { animation-delay: 0.6s, 0.6s, 2.1s; }
.intro-text span:nth-child(7) { animation-delay: 0.7s, 0.7s, 2.2s; }
.intro-text span:nth-child(8) { animation-delay: 0.8s, 0.8s, 2.3s; }

.intro-text span {
    animation: textReveal 0.5s ease-out forwards,
               textGlow 2s ease-in-out infinite,
               letterFadeOut 0.5s ease-in forwards;
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(51, 51, 51, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(51, 51, 51, 0.8);
    }
}

@keyframes introFadeOut {
    0%, 80% {
        opacity: 1;
        visibility: visible;
    }
    100% {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

@keyframes textReveal {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes letterFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) scale(0.8);
    }
}

/* 更新主内容的动画延迟，等待所有字母消失 */
body > *:not(.intro-animation) {
    opacity: 0;
    animation: mainContentFade 1s ease-out 3.2s forwards;
}

/* Hide main content initially */
body > *:not(.intro-animation) {
    opacity: 0;
    animation: mainContentFade 1s ease-out 2.5s forwards;
}

@keyframes mainContentFade {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Page load animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Element animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nav-links li {
    animation: slideIn 0.5s ease-out forwards;
    opacity: 0;
}

.nav-links li:nth-child(1) { animation-delay: 0.2s; }
.nav-links li:nth-child(2) { animation-delay: 0.4s; }
.nav-links li:nth-child(3) { animation-delay: 0.6s; }

.profile-image-container {
    animation: fadeIn 1s ease-out 0.5s forwards;
    opacity: 0;
}

.profile h1 {
    animation: fadeIn 1s ease-out 0.8s forwards;
    opacity: 0;
}

.bio {
    animation: fadeIn 1s ease-out 1s forwards;
    opacity: 0;
}

/* Navigation */
.main-nav {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.nav-link {
    display: block;
    padding: 1rem 2rem;
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    border-radius: 20px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

body {
    padding-top: 3.5rem;
}

/* Cursor trail effect */
.cursor-trail {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: width 0.2s, height 0.2s, transform 0.1s;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.cursor-trail::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    animation: cursorPulse 2s infinite;
}

@keyframes cursorPulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(2.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

/* Cartoon Character Styles */
.cartoon-character {
    position: fixed;
    right: 40px;
    bottom: 40px;
    z-index: 1000;
    width: 120px;
    height: 120px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.cartoon-character:hover {
    transform: scale(1.1);
}

.character-body {
    width: 100%;
    height: 100%;
    background: #ffb6c1;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: bounce 3s ease-in-out infinite;
}

.character-eyes {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    display: flex;
    justify-content: space-between;
}

.eye {
    width: 20px;
    height: 20px;
    background: #333;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.eye::after {
    content: '';
    position: absolute;
    top: 25%;
    left: 25%;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.character-mouth {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 20px;
    border-bottom: 4px solid #333;
    border-radius: 0 0 20px 20px;
    transition: all 0.3s ease;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.65));
    position: relative;
    min-height: 100vh;
    transition: all 0.3s ease-in-out;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Header styles */
.header {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #333;
    position: relative;
    margin-bottom: 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.header .container {
    padding: 60px 0;
    text-align: center;
}

.profile {
    margin-bottom: 30px;
}

.profile-image-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.profile-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    margin-bottom: 25px;
    transition: all 0.5s ease;
    position: relative;
}

.profile-image-container.zoomed .profile-image {
    transform: scale(1.5);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.3);
    z-index: 1000;
}

.profile-image:hover {
    transform: scale(1.08) rotate(5deg);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.2);
}

.profile-image::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: pulseRing 2s infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

/* Background controls */
.background-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 20px;
}

.bg-control {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-control:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.bg-control:active {
    transform: scale(0.95);
}
.profile h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #ffffff, #d4d4d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.7));
    }
    to {
        filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
    }
}

.bio {
    font-size: 1.3rem;
    opacity: 0.9;
    background: linear-gradient(120deg, #ffffff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 500;
    letter-spacing: 1px;
    margin-top: 10px;
}

.stats {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border-radius: 15px;
    padding: 30px;
    margin: 40px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
}

.stats:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.stats-preview {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

.stats-preview .charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.stats-preview figure {
    margin: 0;
    width: 100%;
    min-height: 200px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 20px;
}

@media (max-width: 900px) {
    .stats-preview .charts-container {
        grid-template-columns: 1fr;
    }
}

.stats-preview embed {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .stats-preview figure {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .stats-preview figure {
        height: 200px;
    }
}

.about {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border-radius: 15px;
    padding: 30px;
    margin: 40px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(0);
    transition: all 0.4s ease;
}

.about:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.about p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

/* Main content styles */
.main {
    padding: 60px 0;
    position: relative;
    z-index: 1;
}

section {
    margin-bottom: 60px;
}

h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #333;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.view-all {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 5px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
}

.view-all:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #fff;
    margin-top: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Projects section */
.project-grid {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.project-card {
    background: transparent;
    perspective: 1000px;
    height: 300px;
}

.project-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.project-card:hover .project-card-inner {
    transform: rotateY(180deg);
}

.project-card-front, .project-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-card-back {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-card-back ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.project-card-back li {
    margin: 10px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}


.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: 0.5s;
}

.project-card:hover::before {
    left: 100%;
}

.project-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.project-card p {
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
}

.project-link {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.project-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Footer styles */
.footer {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #333;
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px 0;
    text-align: center;
    margin-top: auto;
}

.social-links {
    margin-bottom: 20px;
}

.social-link-container {
    position: relative;
    display: inline-block;
}

.social-link {
    display: inline-block;
    color: white;
    text-decoration: none;
    margin: 0 10px;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    font-weight: 500;
    letter-spacing: 0.5px;
    position: relative;
}

.social-link[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.9rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.social-link[data-tooltip]::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    bottom: calc(100% - 6px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.social-link[data-tooltip]:hover::before,
.social-link[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 10px);
}

.social-link:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.copyright {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        padding: 40px 0;
    }

    .profile h1 {
        font-size: 2rem;
    }

    .bio {
        font-size: 1.1rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .project-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .profile-image {
        width: 120px;
        height: 120px;
    }

    .profile h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}