:root {
    --card-bg-rgb: 20, 10, 40;
    /* 暗紫蓝底，RGB 可用于透明叠加 */
    --primary-color: #000000;
    /* 夜空般深蓝紫，朋克底色 */
    --secondary-color: #00f7ff;
    /* 赛博荧光蓝 */
    --accent-color: #ff00aa;
    /* 荧光粉红（霓虹） */
    --text-color: #e6e6e6;
    /* 明亮字体（或可试 #ffffff） */
    --card-bg: #1e0033;
    /* 深紫卡片背景 */
    --neon-glow: 0 0 12px rgba(0, 247, 255, 0.9);
    /* 蓝霓虹辉光 */
}





html {
    scroll-padding-top: 90px;
    /* Matches navbar height */
    scroll-behavior: smooth;
    /* Optional: enables smooth scrolling */
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--primary-color);
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
}

/* 为移动设备添加的样式 */
.ldr-shape-container.active .icon-text {
    opacity: 1;
    bottom: -35px;
}

.ldr-shape-container.active .icon-style {
    color: var(--accent-color);
    text-shadow: 0 0 25px var(--accent-color);
    transform: translateY(-5px) scale(1.2);
}









/* Loading Screen */



.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:

        radial-gradient(ellipse at center,
            /* 椭圆渐变，中心发散 */
            #000000 0%,
            /* 中心：深紫黑色（接近太空暗部）*/
            #020314 50%,
            /* 中间过渡：宝石蓝色（模拟宇宙光晕）*/
            #021e2b 100%
            /* 边缘：深海蓝绿色（深邃太空感）*/
        ),
        /* 主太空背景.效果：从中心向外扩散的椭圆渐变，中心最暗，向外渐变成带有蓝绿色调的宇宙空间效果。*/


        
        radial-gradient(circle at 80% 70%,
            /* 圆形渐变，定位在右下方80% 70%位置 */
            rgba(152, 65, 195, 0.048) 0%,
            /* 半透明紫罗兰色 */
            rgba(129, 20, 114, 0.057) 40%
            /* 过渡到半透明深紫色 */
        );
        /* 紫色星云.效果：在右下方添加一团紫红色星云，与左上的蓝色星云形成色彩对比。*/


    background-blend-mode: screen;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.infinity-loader {
    width: 200px;
    height: 100px;
    position: relative;
    perspective: 1000px;
    margin: 0 auto;
}









.mobius-ring {
    width: 100%;
    height: 100%;
    animation: rotate-horizontal 0.8s linear infinite;
    transform-style: preserve-3d;
}

@keyframes rotate-horizontal {
    0% {
        transform: rotateX(0deg);
    }

    100% {
        transform: rotateX(360deg);
    }
}

.infinity-path {
    fill: none;
    stroke: var(--secondary-color);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 250;
    stroke-dashoffset: 250;
    animation: draw 3s cubic-bezier(0.65, 0, 0.35, 1) infinite;
    filter: drop-shadow(0 0 10px var(--secondary-color));
}

.infinity-path:nth-child(2) {
    animation-delay: 0.15s;
}

@keyframes draw {
    0% {
        stroke-dashoffset: 250;
    }

    50% {
        stroke-dashoffset: 0;
    }

    100% {
        stroke-dashoffset: -250;
    }
}

/* 修改.loading-percent添加过渡 */
.loading-percent {
    margin-top: 1px;
    left: 0;
    width: 100%;
    text-align: center;
    color: var(--secondary-color);
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    text-shadow: 0 0 8px var(--secondary-color);
    z-index: 1;
    transition: opacity 0.5s ease-out;
}


/* 修改.loading-status添加过渡 */
.loading-status {
    margin-top: 30px;
    color: var(--secondary-color);
    font-family: 'Michroma', sans-serif;
    font-size: 0.9rem;
    text-align: center;
    max-width: 300px;
    text-shadow: 0 0 8px var(--secondary-color);
    transition: all 0.5s ease-out;
}







.binary-matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: visible;
    pointer-events: none;
    z-index: 999;
    /* 添加这行确保成为定位上下文 */
    transform: none !important;
}

.binary-particle {
    position: absolute;
    /* 改为视口单位确保准确定位 */
    left: 50vw;
    top: 50vh;
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #00f7ff;
    text-shadow: 0 0 8px currentColor, 0 0 16px currentColor;
    opacity: 0;
    animation: binary-fall linear forwards;
    will-change: transform;
    z-index: 10;
    background: rgba(0,0,0,0.3);
    padding: 2px 5px;
    border-radius: 3px;
    /* 初始状态 */
    transform: translate(-50%, -50%) scale(0.5);
}

@keyframes binary-fall {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        /* 关键修改：保留中心偏移计算 */
        transform: 
            translate(
                calc(-50% + var(--tx)), 
                calc(-50% + var(--ty))
            ) 
            scale(1.2);
    }
}

/* 过渡蒙版 */
.transition-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at center, 
        transparent 0%, 
        var(--primary-color) 120%
    );
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    animation: mask-fade 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes mask-fade {
    0% { 
        opacity: 0;
        transform: scale(0.5);
    }
    50% { 
        opacity: 0.9;
        transform: scale(1.8);
    }
    100% { 
        opacity: 0;
        transform: scale(3);
    }
}

/* 修改.infinity-loader添加爆发状态 */
.infinity-loader {
    width: 200px;
    height: 100px;
    position: relative;
    perspective: 1000px;
    margin: 0 auto;
    transition: all 0.5s ease-out;
    overflow: visible; /* 允许内容溢出 */
}

/* 新增爆发动画 */
@keyframes ring-burst {
    0% { 
        transform: rotateX(0deg) scale(1);
        opacity: 1;
    }
    50% {
        transform: rotateX(180deg) scale(1.5);
        opacity: 0.7;
    }
    100% { 
        transform: rotateX(360deg) scale(3);
        opacity: 0;
    }
}


















#earth-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1; /* 与粒子同层级 */
  pointer-events: none;
  opacity: 0; /* 初始隐藏 */
  transition: opacity 1s ease;
}

/* 移除粒子背景的z-index */
#particles-js {
  /* 删除或注释掉原z-index: -1 */
  background-color: transparent !important;
}

/* 加载完成后显示地球 */
body.earth-ready #earth-container {
  opacity: 0.7;
}




/* Navigation Bar */
.navbar {
    height: 40px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(10, 10, 26, 0.728);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Safari 兼容 */
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--secondary-color);
    text-decoration: none;
    background: transparent !important;
}

.nav-links {
    display: flex;
    gap: 1.2rem;
    background: transparent !important;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-family: 'Michroma', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    position: relative;
    padding: 0.4rem 0;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--secondary-color);
    text-shadow: 0 0 8px rgba(0, 247, 255, 0.3);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.2s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Animated Particle Background */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: var(--primary-color);
}

/* Header with Animation */
header {
    padding: 8rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.title-container {
  position: absolute;  /* 脱离文档流 */
  top: 250px;          /* 距离顶部距离 */
  right: 20px;        /* 固定到右侧 */
  text-align: right;  /* 文字右对齐 */
  z-index: 100;      /* 确保在导航栏上方 */
}




.name-title {
    font-size: 6rem;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    color: #fff; /* 纯白更刺眼 */
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 
        0 0 3px #0ff; /* 仅保留最基础光晕 */
    animation: 
        fadeInUp 1s 0.2s forwards,
        hard-glitch 0.4s steps(2, end) infinite;
}

/* 机械式三连击故障 */
@keyframes hard-glitch {
    0%, 70% { /* 70%时间正常 */
        transform: translateX(0);
        text-shadow: 0 0 3px #0ff;
    }
    71%, 73% { /* 第1次跳动 */
        transform: translateX(-5px);
        color: cyan;
        text-shadow: 3px 0 red;
    }
    74%, 76% { /* 第2次跳动 */
        transform: translateX(5px);
        color: red;
        text-shadow: -3px 0 cyan;
    }
    77%, 79% { /* 第3次跳动 */
        transform: translateX(0);
        color: #fff;
        text-shadow: 0 0 10px #0ff;
    }
}





.job-title {
    font-size: 1.8rem;
    font-family: 'Orbitron', sans-serif;
    background: linear-gradient(to right, var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s 0.3s forwards;
}






.ldr-shapes {
  /* 移除原有 margin 和 flex 居中 */
  position: absolute;  /* 改为绝对定位 */
  top: 60px;          /* 距离顶部 20px */
  left: 50%;          /* 水平居中 */
  transform: translateX(-50%); /* 精确居中 */
  display: flex;
  gap: 3rem;          /* 保持图标间距 */
  z-index: 100;      /* 确保悬浮在其他元素上 */
  margin: 0 !important; /* 移除原有 margin */
}

.ldr-shape-container {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.icon-text {
    position: absolute;
    bottom: -25px;
    /* Changed from top to bottom */
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Orbitron', sans-serif;
    color: var(--secondary-color);
    font-size: 0.9rem;
    opacity: 0;
    white-space: nowrap;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px var(--secondary-color);
    pointer-events: none;
}

.icon-style {
    font-size: 3rem;
    color: var(--secondary-color);
    text-shadow: 0 0 15px var(--secondary-color);
    transition: all 0.3s ease;
}

/* Hover effects */
.ldr-shape-container:hover .icon-text {
    opacity: 1;
    bottom: -35px;
    /* Changed from top to bottom */
}

.ldr-shape-container:hover .icon-style {
    color: var(--accent-color);
    text-shadow: 0 0 25px var(--accent-color);
    transform: translateY(-5px) scale(1.2);
    /* Reduced translateY for better balance */
}


@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Scroll Down Animation */
.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    color: var(--secondary-color);
    opacity: 0;
    animation: fadeIn 1s 2s forwards;
}

.mouse {
    width: 25px;
    height: 40px;
    border: 2px solid var(--secondary-color);
    border-radius: 12px;
    position: relative;
    margin-bottom: 8px;
}

.scroller {
    width: 4px;
    height: 8px;
    background: var(--secondary-color);
    border-radius: 2px;
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollDown 1.5s infinite;
}

.scroll-down span {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-top: 5px;
}

@keyframes scrollDown {
    0% {
        top: 5px;
        opacity: 1;
    }

    50% {
        top: 15px;
        opacity: 0.5;
    }

    100% {
        top: 5px;
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) translateX(-50%);
    }

    to {
        opacity: 1;
        transform: translateY(0) translateX(-50%);
    }
}

/* Animated Cards */
.card {
    background: var(--card-bg);
    background: rgba(var(--card-bg-rgb), 0.5);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2.5rem;
    margin: 2rem auto;
    max-width: 900px;
    border: 1px solid rgba(0, 247, 255, 0.2);

    /* 修改点1：修正transition语法，合并动画属性 */
    transition:
        opacity 0.4s ease-out,
        transform 0.4s ease-out,
        box-shadow 0.3s ease,
        border-color 0.3s ease;

    /* 修改点2：添加初始transform状态 */
    transform: translateY(20px);
    opacity: 0;

    /* 修改点3：添加GPU加速优化 */
    will-change: transform, opacity;
    transform-style: preserve-3d;

    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* 修改点4：简化visible动画，改用transition驱动 */
.card.visible {
    opacity: 1;
    transform: translateY(0);
    /* 移除原来的animation */
}

/* 修改点5：优化悬停动画性能 */
.card:hover {
    transform: translateY(-5px) scale(1.02);
    /* 减小移动幅度 */
    box-shadow: 0 15px 30px rgba(0, 247, 255, 0.2);
    border-color: var(--secondary-color);
}

/* 修改点6：为标题添加will-change优化 */
h2 {
    font-family: 'Orbitron', sans-serif;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 2rem;
    position: relative;
    display: inline-block;
    will-change: transform;
    /* 新增 */
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 3px;
}

h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--text-color);
    margin: 1.5rem 0 0.5rem;
    font-size: 1.3rem;
}

p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Neon Button */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    margin: 1rem 0.5rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Orbitron', sans-serif;
    position: relative;
    overflow: hidden;
}

/* 探索按钮 - 靠右对齐 */
.explore-btn {
  display: inline-block;
  margin-top: 300px; /* 与job-title的间距 */
  position: relative;
  z-index: 100;
  animation: float 3s ease-in-out infinite;
  margin-left: auto; /* 关键：自动左外边距实现右对齐 */
  display: block; /* 需要设置为block才能用margin-left: auto */
  width: fit-content; /* 宽度根据内容自适应 */
}

.btn:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
    box-shadow: var(--neon-glow);
    transform: translateY(-3px);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 247, 255, 0.4), transparent);
    transition: all 0.3s ease;
}

.btn:hover::before {
    left: 100%;
}

/* Skills Section */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.skill {
    background: rgba(0, 247, 255, 0.1);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    border: 1px solid var(--secondary-color);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    opacity: 0;
}

.skill:hover {
    background: rgba(0, 247, 255, 0.3);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 247, 255, 0.2);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
    margin-top: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--secondary-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
    padding-left: 1.5rem;
    opacity: 0;
    transform: translateX(20px);
    /* 添加这一行 */
    transition: all 0.8s ease;
    /* 添加这一行 */
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 0, 170, 0.3);
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

/* Project Gallery */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.project-card {
    background: rgba(30, 30, 58, 0.7);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid rgba(0, 247, 255, 0.1);
    transition: all 0.2s ease;
    opacity: 0;
}

.project-card:hover {
    transform: translateY(-5px) rotate(1deg);
    border-color: var(--secondary-color);
    box-shadow: 0 10px 20px rgba(0, 247, 255, 0.1);
}

/* Enhanced Social Icon Animations */
.contact-icons a {
    display: inline-block;
    position: relative;
    transition: all 0.2s ease;
}

.contact-icons a i {
    transition: all 0.2s ease;
}

.contact-icons a:hover {
    transform: translateY(-5px) scale(1.1);
}

.contact-icons a:hover i {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-color);
}

/* Specific icon animations */
.contact-icons a:hover .fa-envelope {
    animation: shake 0.3s ease;
}

.contact-icons a:hover .fa-linkedin {
    animation: pulse 0.3s ease;
}

.contact-icons a:hover .fa-github {
    animation: spin 0.3s ease;
}

.contact-icons a:hover .fa-phone {
    animation: ring 0.3s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    75% {
        transform: translateX(3px);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes ring {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(15deg);
    }

    75% {
        transform: rotate(-15deg);
    }
}

/* ===== 新增GPU加速 ===== */
.card,
.project-card,
.timeline-item,
.skill {
    will-change: transform, opacity;
    /* 预声明变化的属性 */
    transform: translateZ(0);
    /* 强制GPU加速 */
}

/* ===== 新增简化动画 ===== */
@keyframes optimizedFadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes optimizedFadeInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .name-title {
        font-size: 2.5rem;
    }

    .job-title {
        font-size: 1.4rem;
    }


    .card {
        padding: 1.5rem;
    }

    .project-gallery {
        grid-template-columns: 1fr;
    }

    .navbar {
        padding: 1rem;
    }

    .nav-links {
        gap: 0.9rem;
    }

    .nav-link {
        font-size: 0.7rem;
    }

    .ldr-shape-container {
        width: 70px;
        /* 减小容器宽度 */
        height: 70px;
        /* 减小容器高度 */
    }

    .icon-style {
        font-size: 2.5rem;
        /* 减小图标大小 */
    }

    .icon-text {
        font-size: 0.8rem;
        /* 减小文字大小 */
        bottom: -22px;
        /* 调整文字位置 */
    }

}


@media (max-width: 480px) {
    .ldr-shape-container {
        width: 50px;
        height: 50px;
        gap: 1.5rem;
        /* 减小图标间距 */
    }

    .icon-style {
        font-size: 1.8rem;
    }

    .icon-text {
        font-size: 0.6rem;
        bottom: -15px;
    }

    .nav-links {
        display: none;
        /* Hide nav links on very small screens */
    }

    .nav-logo {
        font-size: 1.2rem;
    }

}