/* Hero Section 动态几何图形样式 */
.hero-visual {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.geometric-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 50vh;
    max-height: 600px;
}

/* 确保所有元素使用相对单位 */
.geo-item {
    position: absolute;
    animation-duration: 6s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(0.8rem + 1vw); /* 使用相对单位 */
}

/* 覆盖内联样式的字体大小 */
.geo-item i {
    font-size: inherit;
}

/* 添加响应式调整 */
@media (max-width: 1200px) {
    .geometric-container {
        min-height: 45vh;
    }
    .geo-item {
        transform: scale(0.9);
    }
}

@media (max-width: 992px) {
    .geometric-container {
        min-height: 40vh;
    }
    .geo-item {
        transform: scale(0.8);
    }
}

@media (max-width: 768px) {
    .geometric-container {
        min-height: 35vh;
    }
    .geo-item {
        transform: scale(0.7);
    }
}

@media (max-width: 576px) {
    .geometric-container {
        min-height: 30vh;
    }
    .geo-item {
        transform: scale(0.6);
    }
}

.geo-item {
    position: absolute;
    animation-duration: 6s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 不同元素的动画 */
.block-1 {
    animation-name: float-1;
    animation-delay: 0.2s;
}

.block-2 {
    animation-name: float-2;
    animation-delay: 1.5s;
}

.puzzle {
    animation-name: rotate-float;
    animation-delay: 0.7s;
}

.crayon {
    animation-name: float-3;
    animation-delay: 2s;
}

.car {
    animation-name: drive;
    animation-delay: 0.5s;
}

.star-1, .star-2 {
    animation-name: twinkle;
}

.star-1 {
    animation-delay: 1s;
}

.star-2 {
    animation-delay: 2.5s;
}

.balloon {
    animation-name: float-up;
    animation-delay: 0.3s;
}

.tablet {
    animation-name: pulse;
}

.laptop {
    animation-name: laptop-pulse; /* 为laptop创建特定的动画 */
    animation-delay: 1.2s;
}

.tablet {
    animation-delay: 2.8s;
}

.circle {
    animation-name: float-2;
    animation-delay: 1.8s;
}

.ball {
    animation-name: ball-appear;
    animation-delay: 2.5s; /* 添加延迟，使其不会突兀出现 */
    opacity: 0; /* 初始状态设为透明 */
    animation-fill-mode: forwards; /* 确保动画结束后保持最终状态 */
}

.triangle {
    animation-name: float-3;
    animation-delay: 0.9s;
}

/* 为小图案添加随机漂浮动画 */
.music-note {
    animation-name: random-float-1;
    animation-delay: 0.5s;
    animation-duration: 15s; /* 较长的动画时间，使移动更平缓 */
}

.scissors {
    animation-name: random-float-2;
    animation-delay: 1.2s;
    animation-duration: 18s;
}

.paper-plane {
    animation-name: random-float-3;
    animation-delay: 0.8s;
    animation-duration: 20s;
}

/* 悬停效果 */
.geo-item {
    transition: all 0.3s ease;
}

.geo-item:hover {
    transform: scale(1.2) translateY(-5px);
    filter: brightness(1.2);
    cursor: default; /* 将鼠标光标设置为默认箭头 */
    z-index: 10;
}

/* 特殊悬停效果 */
.laptop:hover {
    transform: translate(-50%, -50%) scale(1.15);
    filter: drop-shadow(0 0 10px rgba(74, 144, 226, 0.6));
}

/* 小图案的特殊悬停效果 */
.music-note:hover {
    animation-play-state: running !important; /* 确保悬停时动画继续播放 */
    filter: brightness(1.3);
}

.scissors:hover {
    animation-play-state: running !important;
    filter: brightness(1.3);
}

.paper-plane:hover {
    animation-play-state: running !important;
    filter: brightness(1.3);
}

.puzzle:hover {
    transform: scale(1.2) rotate(15deg);
}

.car:hover {
    transform: translateX(10px) scale(1.15);
}

.block-1:hover, .block-2:hover, .block-3:hover {
    transform: scale(1.2) rotate(10deg);
}

/* 动画关键帧 - 增大范围 */
@keyframes float-1 {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-25px);
    }
}

@keyframes float-2 {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    50% {
        transform: translateY(-20px) translateX(15px);
    }
}

/* 新增：随机漂浮动画 */
@keyframes random-float-1 {
    0% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(30px, -20px);
    }
    50% {
        transform: translate(10px, 25px);
    }
    75% {
        transform: translate(-25px, 5px);
    }
    100% {
        transform: translate(0, 0);
    }
}

@keyframes random-float-2 {
    0% {
        transform: translate(0, 0);
    }
    20% {
        transform: translate(-15px, 25px);
    }
    40% {
        transform: translate(25px, 10px);
    }
    60% {
        transform: translate(5px, -20px);
    }
    80% {
        transform: translate(-20px, -10px);
    }
    100% {
        transform: translate(0, 0);
    }
}

@keyframes random-float-3 {
    0% {
        transform: translate(0, 0);
    }
    33% {
        transform: translate(20px, 15px);
    }
    66% {
        transform: translate(-15px, -25px);
    }
    100% {
        transform: translate(0, 0);
    }
}

/* 为ball元素创建特定的动画 */
@keyframes ball-appear {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float-3 {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(45deg);
    }
    50% {
        transform: translateY(-22px) translateX(-15px) rotate(45deg);
    }
}

@keyframes rotate-float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(25deg);
    }
}

@keyframes drive {
    0% {
        transform: translateX(-30px);
    }
    50% {
        transform: translateX(30px);
    }
    100% {
        transform: translateX(-30px);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

@keyframes float-up {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-40px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* 为laptop元素创建特定的动画，保持居中位置 */
@keyframes laptop-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
}
