/* ========== Section 3 整体样式 ========== */
.section-projects {
    position: relative;
    background: #0a0a0a;
    min-height: 100%;
    max-height: 100%;
    transition: background-color 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 阶段二激活时的浅色背景 */
.section-projects.stage2-active {
    background: var(--background-light);
}

.section-projects .content-placeholder {
    position: relative;
    width: 100%;
}

/* ========== 第一阶段样式 ========== */
.section3-stage1 {
    position: absolute;
    width: 100%;
    height: 100%;
    min-height: calc(100% - 80px);
    max-height: calc(100% - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease;
    z-index: 1;
}

/* 标题容器动画 */
.section3-stage1 .title-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    text-align: center;

    width: 70vw;
}

.section3-stage1.title-moved .title-container {
    top: 5%;
    transform: translate(-50%, 0);
}

.section3-stage1 .section3-title {
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 300;
    letter-spacing: 0.02em;
    line-height: 1.4;
    color: #fff;
}

.section3-stage1 .section3-title .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    margin: 0 0.3em;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section3-stage1 .section3-title .word.visible {
    opacity: 1;
    transform: translateY(0);
}

.section3-stage1 .section3-1 {
    top: 50vh;
}

/* 第一阶段内容区域 */
.section3-stage1 .animation-container {
    top: 7vh;
    opacity: 0;
    transform: scale(0.9);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.section3-stage1.content-visible .animation-container {
    opacity: 1;
    transform: scale(1);
}

/* 交互提醒文字 */
.section3-stage1 .interaction-hint {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
    z-index: 20;
}

.section3-stage1.hint-visible .interaction-hint {
    opacity: 1;
}

.section3-stage1 .hint-text {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.1em;
    margin: 0;
    animation: hintFloat 2s ease-in-out infinite, hintPulse 2s ease-in-out infinite;
}


/* 脉冲动画 - 透明度变化 */
@keyframes hintPulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* ========== 第二阶段样式 ========== */
.section3-stage2 {
    position: absolute;
    width: 100%;
    height: 100%;
    min-height: calc(100% - 80px);
    max-height: calc(100% - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.section3-stage2.active {
    opacity: 1;
    pointer-events: auto;
}

/* 电脑屏幕容器 */
.section3-stage2 .computer-screen {
    position: relative;
    width: 40%;
    max-width: 600px;
    aspect-ratio: 16/10;
    /* 恢复宽高比定义 */
    overflow: hidden;
}

.section3-stage2 .screen-content {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
    /* 使用transform代替scale属性 */
}

.section3-stage2 .screen-content img {
    object-fit: contain;
}

/* 第二阶段标题容器 */
.section3-stage2 .stage2-title {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

.section3-stage2 .stage2-title h3 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 300;
    letter-spacing: 0.02em;
    line-height: 1.4;
    color: #fff;
    transition: color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.section3-stage2.active .stage2-title h3 {
    color: var(--primary-medium);
}

/* 标题中的单词动画 */
.section3-stage2 .stage2-title .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px) scale(0.8);
    margin: 0 0.3em;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section3-stage2 .stage2-title .word.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* 生物计算机图片容器 */
.section3-stage2 .bio-computer {
    position: relative;
    width: 40%;
    max-width: 600px;
    opacity: 0;
    transform: translateX(50px) scale(0.9);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

.section3-stage2.active .bio-computer {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.section3-stage2 .bio-computer img {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0, 150, 255, 0.3));
    transition: filter 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.section3-stage2.active .bio-computer img {
    filter: drop-shadow(0 10px 30px rgba(0, 100, 180, 0.25));
}

/* ========== Glitch 效果 Canvas ========== */
#section3GlitchCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.1s ease;
}

/* ========== 动画状态 ========== */
.section-projects.animating {
    pointer-events: none;
}

.section-projects.animating * {
    pointer-events: none;
}

/* 隐藏第一阶段 */
.section-projects.stage2-active .section3-stage1 {
    opacity: 0;
    pointer-events: none;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
    .section3-stage2 {
        flex-direction: column;
        gap: 3%;
    }

    .section3-stage2 .computer-screen {
        width: 60%;
        max-width: 500px;
    }

    .section3-stage2 .stage2-text {
        width: 60%;
        height: auto;
        padding: 30px;
    }

    .section3-stage2 .stage2-text h3 {
        font-size: 1.5rem;
    }

    .section3-stage2 .stage2-text p {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .section3-stage1 .section3-title {
        font-size: 1.5rem;
    }

    .section3-stage2 .computer-screen {
        width: 80%;
    }

    .section3-stage2 .stage2-text {
        width: 80%;
    }
}