/* 技术栈容器 */
.tech-stack {
    position: relative;
    z-index: 1;
    animation: matrix 5s infinite linear;
    background: #010101;
    padding: 40px 0;
    color: white;
}

/* 卡片容器样式 */
.tech-card-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    flex-wrap: wrap; /* 允许卡片换行，防止超出边框 */
}

/* 单个卡片样式 */
.tech-card {
    background-color: rgba(255, 255, 255, 0.7); 
    border-radius: 10px;
    padding: 20px;
    width: 200px; /* 设置一个固定宽度 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
    animation: slideLeft 2s ease-in-out infinite alternate;
}

/* 当鼠标悬停时，展示详细内容 */
.tech-card:hover {
    transform: translateY(-10px);
}

/* 卡片标题 */
.tech-card h2 {
    font-size: 1.5rem;
    margin-top: 20%;
    font-family: Georgia, 'Times New Roman', Times, serif;
    color: black;
}

.tech-card h1 {
    font-size: 2.5rem;
    margin-top: 20%;
    font-family: Georgia, 'Times New Roman', Times, serif;
    color: black;
}

/* 技术栈描述，默认不显示 */
.tech-description {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    color: black;
}

/* 鼠标悬停时，显示文字并隐藏标题 */
.tech-card:hover h1, .tech-card:hover h2 {
    opacity: 0;
}

.tech-card:hover .tech-description {
    opacity: 1;
    visibility: visible;
}

/* 正在学习栈部分 */
.Learning-card-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    flex-wrap: wrap; /* 允许卡片换行 */
}

/* 学习卡片样式，和技术栈卡片相同，增加滑动动画 */
.Learning-card {
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    padding: 20px;
    width: 200px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
    animation: slideLeft 2s ease-in-out infinite alternate;
}

.Learning-title {
    font-size: 2.5rem;
    margin-top: 20%;
    font-family: Georgia, 'Times New Roman', Times, serif;
    color: black;
}
/* 错开卡片的动画 */
.Learning-card:nth-child(1) {
    animation-delay: 0s;
}

.Learning-card:nth-child(2) {
    animation-delay: 0.5s;
}

.Learning-card:nth-child(3) {
    animation-delay: 1s;
}

.Learning-card:nth-child(4) {
    animation-delay: 1.5;
}

.tech-card:nth-child(1) {
    animation-delay: 0.25;
}

.tech-card:nth-child(2) {
    animation-delay: 0.75;
}

.tech-card:nth-child(3) {
    animation-delay: 1.25;
}

.tech-card:nth-child(4) {
    animation-delay: 1.75;
}


@keyframes slideLeft {
    0% {
        transform: translateX(0);  /* 从原始位置开始 */
    }
    50% {
        transform: translateX(-20px);  /* 左移 */
    }
    100% {
        transform: translateX(0);  /* 回到原始位置 */
    }
}


/* 矩阵背景动画 */
@keyframes matrix {
    0% { background: white; }
    25% { background: #6ee76e; }
    50% { background: rgb(128, 128, 247); }
    75% { background: rgb(248, 181, 192); }
    100% { background: white; }
}

@media (max-width: 768px) {
    .tech-card-container,
    .Learning-card-container {
        gap: 10px; 
        justify-content: flex-start; 
    }

    .tech-card,
    .Learning-card {
        width: 150px; 
        animation: slideLeft 2 ease-in-out infinite alternate; /* 保持移动效果 */
    }
}

@media (max-width: 480px) {
    .tech-card,
    .Learning-card {
        width: 130px;  /* 更小的卡片宽度 */
    }
}
