/* 作品集视觉增强 - 动态背景 */

/* 通用样式 */
.portfolio-visual-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    opacity: 0.3;
    transition: opacity 0.6s ease;
}

.portfolio-item:hover .portfolio-visual-bg {
    opacity: 0.6;
}

/* ========== 作品1：电商微服务 - 几何粒子流动 ========== */
.visual-ecommerce {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.visual-ecommerce::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 61, 0, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 61, 0, 0.2) 0%, transparent 50%);
    animation: particleFlow 20s ease-in-out infinite;
}

@keyframes particleFlow {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-10%, -10%); }
    50% { transform: translate(-5%, 5%); }
    75% { transform: translate(5%, -5%); }
}

.visual-ecommerce .grid-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 61, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 61, 0, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridMove 15s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}

.visual-ecommerce .floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.visual-ecommerce .shape {
    position: absolute;
    border: 2px solid rgba(255, 61, 0, 0.5);
    animation: floatShape 10s ease-in-out infinite;
}

.visual-ecommerce .shape:nth-child(1) {
    width: 60px;
    height: 60px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.visual-ecommerce .shape:nth-child(2) {
    width: 40px;
    height: 40px;
    top: 60%;
    right: 15%;
    border-radius: 50%;
    animation-delay: 2s;
}

.visual-ecommerce .shape:nth-child(3) {
    width: 50px;
    height: 50px;
    bottom: 20%;
    left: 30%;
    transform: rotate(45deg);
    animation-delay: 4s;
}

@keyframes floatShape {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.5; }
    50% { transform: translateY(-20px) rotate(180deg); opacity: 1; }
}

/* ========== 作品2：3D监控大屏 - 粒子爆炸 ========== */
.visual-3d-monitor {
    background: radial-gradient(circle at center, #1a0a0a 0%, #000000 100%);
}

.visual-3d-monitor .particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.visual-3d-monitor .particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    animation: explodeParticle 8s ease-out infinite;
}

@keyframes explodeParticle {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(1);
        opacity: 0;
    }
}

/* ========== 作品3：数据分析 - 数据流 ========== */
.visual-data-analysis {
    background: linear-gradient(180deg, #0a1a0a 0%, #000000 100%);
}

.visual-data-analysis .data-stream {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.visual-data-analysis .stream-line {
    position: absolute;
    width: 2px;
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(255, 61, 0, 0.8), transparent);
    animation: streamFlow 3s linear infinite;
}

@keyframes streamFlow {
    0% { transform: translateY(-100px); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(calc(100vh + 100px)); opacity: 0; }
}

.visual-data-analysis .chart-bars {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.visual-data-analysis .bar {
    width: 12px;
    background: var(--accent);
    animation: barGrow 2s ease-in-out infinite;
}

@keyframes barGrow {
    0%, 100% { height: 20px; opacity: 0.5; }
    50% { height: 80px; opacity: 1; }
}

/* ========== 作品4：3D博客 - WebGL 风格 ========== */
.visual-3d-blog {
    background: linear-gradient(135deg, #0a0a2a 0%, #1a1a4a 100%);
}

.visual-3d-blog .geometric-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    perspective: 1000px;
}

.visual-3d-blog .geo-shape {
    position: absolute;
    border: 3px solid rgba(255, 61, 0, 0.6);
    animation: rotate3D 15s linear infinite;
}

@keyframes rotate3D {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

.visual-3d-blog .geo-shape:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 15%;
    transform-style: preserve-3d;
}

.visual-3d-blog .geo-shape:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 50%;
    right: 20%;
    border-radius: 50%;
    animation-duration: 20s;
}

.visual-3d-blog .geo-shape:nth-child(3) {
    width: 70px;
    height: 70px;
    bottom: 25%;
    left: 40%;
    animation-duration: 25s;
    animation-direction: reverse;
}

/* ========== 作品5：代码生成器 - 代码雨 ========== */
.visual-code-generator {
    background: #0a0a0a;
    font-family: 'Courier New', monospace;
    overflow: hidden;
}

.visual-code-generator .code-rain {
    position: absolute;
    width: 100%;
    height: 100%;
}

.visual-code-generator .code-column {
    position: absolute;
    top: -100%;
    font-size: 14px;
    color: rgba(255, 61, 0, 0.6);
    line-height: 1.2;
    animation: codeFall 10s linear infinite;
    white-space: nowrap;
}

@keyframes codeFall {
    0% { transform: translateY(0); }
    100% { transform: translateY(calc(100vh + 200%)); }
}

/* ========== 作品6：CI/CD - 节点网络 ========== */
.visual-cicd {
    background: linear-gradient(135deg, #1a1a0a 0%, #2a2a1a 100%);
}

.visual-cicd .network-nodes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.visual-cicd .node {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulseNode 2s ease-in-out infinite;
}

.visual-cicd .node::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 61, 0, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 2s ease-out infinite;
}

@keyframes pulseNode {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

@keyframes ripple {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

.visual-cicd .connection-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 61, 0, 0.5), transparent);
    animation: dataFlow 3s linear infinite;
}

@keyframes dataFlow {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========== 增强悬停效果 ========== */
.portfolio-item:hover .portfolio-visual-bg {
    opacity: 0.8;
}

.portfolio-item:hover .visual-ecommerce .grid-lines {
    animation-duration: 5s;
}

.portfolio-item:hover .visual-3d-monitor .particle {
    animation-duration: 2s;
}

.portfolio-item:hover .visual-data-analysis .bar {
    animation-duration: 0.5s;
}

.portfolio-item:hover .visual-3d-blog .geo-shape {
    animation-duration: 5s;
}

.portfolio-item:hover .visual-code-generator .code-column {
    animation-duration: 3s;
}

.portfolio-item:hover .visual-cicd .node {
    animation-duration: 0.5s;
}
