/* 博客文章视觉增强 - 动态配图 */

/* ========== 通用文章头图样式 ========== */
.article-visual-header {
    position: relative;
    width: 100%;
    height: 400px;
    margin-bottom: 3rem;
    border-radius: 12px;
    overflow: hidden;
    background: var(--black);
}

.article-visual-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
}

/* ========== Java 性能优化 - JVM 架构图 ========== */
.visual-java-performance {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.visual-java-performance .jvm-architecture {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.visual-java-performance .jvm-layer {
    position: relative;
    width: 80%;
    max-width: 500px;
    padding: 1.5rem;
    background: rgba(255, 61, 0, 0.1);
    border: 2px solid rgba(255, 61, 0, 0.3);
    border-radius: 8px;
    text-align: center;
    animation: layerGlow 3s ease-in-out infinite;
}

.visual-java-performance .jvm-layer::before {
    content: attr(data-label);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.2rem;
    color: var(--accent);
    letter-spacing: 0.1em;
}

.visual-java-performance .jvm-layer:nth-child(1) {
    animation-delay: 0s;
}

.visual-java-performance .jvm-layer:nth-child(2) {
    animation-delay: 0.5s;
}

.visual-java-performance .jvm-layer:nth-child(3) {
    animation-delay: 1s;
}

@keyframes layerGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 61, 0, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 61, 0, 0.5);
        transform: scale(1.02);
    }
}

.visual-java-performance .data-flow {
    position: absolute;
    width: 2px;
    height: 40px;
    left: 50%;
    background: linear-gradient(to bottom, transparent, var(--accent), transparent);
    animation: flowDown 2s linear infinite;
}

@keyframes flowDown {
    0% { transform: translateY(-40px); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(40px); opacity: 0; }
}

/* ========== Three.js 数据可视化 - 3D 粒子场景 ========== */
.visual-threejs {
    background: radial-gradient(circle at center, #1a0a2e 0%, #000000 100%);
}

.visual-threejs .particle-scene {
    position: absolute;
    width: 100%;
    height: 100%;
}

.visual-threejs .particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 61, 0, 0.8);
    animation: floatParticle 10s ease-in-out infinite;
}

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

.visual-threejs .geometry {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    border: 3px solid rgba(255, 61, 0, 0.6);
    transform: translate(-50%, -50%);
    animation: rotateGeometry 20s linear infinite;
}

.visual-threejs .geometry:nth-child(2) {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    animation-duration: 25s;
    animation-direction: reverse;
}

.visual-threejs .geometry:nth-child(3) {
    width: 100px;
    height: 100px;
    transform: translate(-50%, -50%) rotate(45deg);
    animation-duration: 15s;
}

@keyframes rotateGeometry {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========== Python 数据管道 - 数据流图 ========== */
.visual-python-data {
    background: linear-gradient(180deg, #0a1a2e 0%, #000000 100%);
}

.visual-python-data .pipeline {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
}

.visual-python-data .pipeline-stage {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(255, 61, 0, 0.1);
    border: 2px solid rgba(255, 61, 0, 0.4);
    border-radius: 50%;
    animation: stagePulse 2s ease-in-out infinite;
}

.visual-python-data .pipeline-stage::before {
    content: attr(data-stage);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.visual-python-data .pipeline-stage:nth-child(1) { animation-delay: 0s; }
.visual-python-data .pipeline-stage:nth-child(2) { animation-delay: 0.3s; }
.visual-python-data .pipeline-stage:nth-child(3) { animation-delay: 0.6s; }
.visual-python-data .pipeline-stage:nth-child(4) { animation-delay: 0.9s; }

@keyframes stagePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 61, 0, 0.2);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 40px rgba(255, 61, 0, 0.5);
    }
}

.visual-python-data .flow-arrow {
    position: absolute;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: arrowFlow 1.5s linear infinite;
}

@keyframes arrowFlow {
    0% { transform: translateX(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

/* ========== 微服务架构 - 服务网格 ========== */
.visual-microservice {
    background: linear-gradient(135deg, #1a2e1a 0%, #0a1a0a 100%);
}

.visual-microservice .service-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1rem;
    padding: 2rem;
}

.visual-microservice .service-node {
    position: relative;
    background: rgba(255, 61, 0, 0.1);
    border: 2px solid rgba(255, 61, 0, 0.3);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: nodeBlink 3s ease-in-out infinite;
}

.visual-microservice .service-node::before {
    content: attr(data-service);
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
}

.visual-microservice .service-node:nth-child(odd) {
    animation-delay: 0.5s;
}

@keyframes nodeBlink {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.95);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.visual-microservice .connection-lines {
    position: absolute;
    width: 100%;
    height: 100%;
}

.visual-microservice .connection {
    position: absolute;
    height: 2px;
    background: rgba(255, 61, 0, 0.5);
    animation: connectionPulse 2s ease-in-out infinite;
}

@keyframes connectionPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ========== MySQL 性能优化 - 数据库图表 ========== */
.visual-mysql {
    background: linear-gradient(180deg, #1a1a0a 0%, #000000 100%);
}

.visual-mysql .database-structure {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.visual-mysql .table {
    position: relative;
    width: 60%;
    max-width: 400px;
    background: rgba(255, 61, 0, 0.1);
    border: 2px solid rgba(255, 61, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    animation: tableGlow 2s ease-in-out infinite;
}

.visual-mysql .table-header {
    padding: 1rem;
    background: rgba(255, 61, 0, 0.2);
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.visual-mysql .table-row {
    padding: 0.8rem 1rem;
    border-top: 1px solid rgba(255, 61, 0, 0.2);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    animation: rowHighlight 3s ease-in-out infinite;
}

.visual-mysql .table-row:nth-child(odd) {
    animation-delay: 0.5s;
}

@keyframes rowHighlight {
    0%, 100% {
        background: transparent;
    }
    50% {
        background: rgba(255, 61, 0, 0.1);
    }
}

@keyframes tableGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 61, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 61, 0, 0.4);
    }
}

.visual-mysql .query-flow {
    position: absolute;
    width: 2px;
    height: 100px;
    left: 50%;
    background: linear-gradient(to bottom, transparent, var(--accent), transparent);
    animation: queryFlow 2s linear infinite;
}

@keyframes queryFlow {
    0% { transform: translateY(-100px); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(100px); opacity: 0; }
}

/* ========== 前端性能优化 - 加载时间线 ========== */
.visual-frontend {
    background: linear-gradient(135deg, #2e1a2e 0%, #1a0a1a 100%);
}

.visual-frontend .loading-timeline {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
}

.visual-frontend .timeline-item {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 2rem;
    animation: timelineSlide 1s ease-out forwards;
    opacity: 0;
}

.visual-frontend .timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 20px rgba(255, 61, 0, 0.6);
}

.visual-frontend .timeline-item::after {
    content: '';
    position: absolute;
    left: 9px;
    top: 60%;
    width: 2px;
    height: 100%;
    background: rgba(255, 61, 0, 0.3);
}

.visual-frontend .timeline-item:last-child::after {
    display: none;
}

.visual-frontend .timeline-item:nth-child(1) { animation-delay: 0.2s; }
.visual-frontend .timeline-item:nth-child(2) { animation-delay: 0.4s; }
.visual-frontend .timeline-item:nth-child(3) { animation-delay: 0.6s; }
.visual-frontend .timeline-item:nth-child(4) { animation-delay: 0.8s; }

@keyframes timelineSlide {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.visual-frontend .timeline-label {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.visual-frontend .timeline-time {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.visual-frontend .progress-bar {
    position: absolute;
    bottom: 2rem;
    left: 3rem;
    right: 3rem;
    height: 4px;
    background: rgba(255, 61, 0, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.visual-frontend .progress-fill {
    height: 100%;
    background: var(--accent);
    animation: progressLoad 3s ease-in-out infinite;
}

@keyframes progressLoad {
    0% { width: 0%; }
    50% { width: 80%; }
    100% { width: 100%; }
}

/* ========== 博客卡片缩略图 ========== */
.blog-card-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    overflow: hidden;
}

.blog-card-thumbnail::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: inherit;
    animation: thumbnailZoom 20s ease-in-out infinite;
}

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

/* Java 卡片 */
.blog-card-thumbnail.thumbnail-java {
    background: 
        linear-gradient(135deg, rgba(255, 61, 0, 0.2), transparent),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 40px,
            rgba(255, 61, 0, 0.1) 40px,
            rgba(255, 61, 0, 0.1) 41px
        );
}

/* Three.js 卡片 */
.blog-card-thumbnail.thumbnail-threejs {
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 61, 0, 0.3), transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 61, 0, 0.2), transparent 50%);
}

/* Python 卡片 */
.blog-card-thumbnail.thumbnail-python {
    background: 
        linear-gradient(45deg, rgba(255, 61, 0, 0.15), transparent),
        linear-gradient(-45deg, rgba(255, 61, 0, 0.15), transparent);
}

/* 微服务卡片 */
.blog-card-thumbnail.thumbnail-microservice {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 61, 0, 0.2), transparent 20%),
        radial-gradient(circle at 75% 25%, rgba(255, 61, 0, 0.2), transparent 20%),
        radial-gradient(circle at 50% 75%, rgba(255, 61, 0, 0.2), transparent 20%);
    background-size: 100px 100px;
}

/* MySQL 卡片 */
.blog-card-thumbnail.thumbnail-mysql {
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 20px,
            rgba(255, 61, 0, 0.1) 20px,
            rgba(255, 61, 0, 0.1) 22px
        );
}

/* 前端卡片 */
.blog-card-thumbnail.thumbnail-frontend {
    background: 
        linear-gradient(90deg, rgba(255, 61, 0, 0.1), transparent, rgba(255, 61, 0, 0.1));
    background-size: 200% 100%;
    animation: gradientSlide 3s ease-in-out infinite;
}

@keyframes gradientSlide {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 0%; }
}
