/* 首页专属样式 */

/* 添加页面加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content {
    animation: fadeInUp 0.8s ease-out;
    text-align: center;
    padding: 2rem 2rem;
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(74, 107, 175, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
}

.hero-content h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    max-width: 800px;
}

.hero-content .hero-subtitle {
    font-size: 1.3rem;
    font-weight: 300;
    color: white;
    max-width: 950px;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    word-wrap: break-word;
    overflow: hidden;
}

.module-grid {
    animation: fadeInUp 1s ease-out 0.3s both;
    padding: 3rem 1rem;
}

.module-card {
    animation: fadeInUp 1s ease-out both;
    transition: all 0.3s ease;
}

.module-card:nth-child(1) { animation-delay: 0.1s; }
.module-card:nth-child(2) { animation-delay: 0.15s; }
.module-card:nth-child(3) { animation-delay: 0.2s; }
.module-card:nth-child(4) { animation-delay: 0.25s; }
.module-card:nth-child(5) { animation-delay: 0.3s; }
.module-card:nth-child(6) { animation-delay: 0.35s; }

/* 玻璃态效果增强 */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 搜索框聚焦效果 */
.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 107, 175, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 107, 175, 0.7);
}

/* 模块卡片悬停时的阴影效果 */
.module-card:hover {
    box-shadow:
        0 20px 40px rgba(31, 38, 135, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* 添加一个微妙的背景动画 */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* 标签样式优化 */
.nav-links a {
    position: relative;
    transition: all 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4a6baf, #6b5b95);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* 轮播样式 */
.hero-carousel {
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.carousel-container {
    display: flex;
    transition: transform 0.5s ease-in-out;
    will-change: transform; /* 优化性能 */
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    padding: 2rem;
    background: transparent; /* 使用透明背景，让轮播区背景显示 */
    position: relative;
    z-index: 1; /* 确保所有滑块在同一层级 */
    opacity: 0; /* 默认隐藏 */
    visibility: hidden; /* 默认隐藏 */
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    height: 100%;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2; /* 活动滑块在最上层 */
}

.carousel-content {
    display: flex;
    align-items: center;
    gap: 3rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: 400px;
}

.carousel-image {
    flex: 0 0 40%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    height: 100%;
}

.carousel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

.carousel-text {
    flex: 0 0 60%;
    color: white;
    text-align: left;
    max-width: 600px;
    display: flex;
    flex-direction: column;
}

.icon-container {
    display: inline-flex;
    align-items: center;
    margin-right: 0.8rem;
}

.carousel-icon {
    width: 32px;
    height: 32px;
    fill: white;
}

.carousel-text h3 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: white;
    line-height: 1.3;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.carousel-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 0.6rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
    word-wrap: break-word;
}

.carousel-dots {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.8rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: white;
    transform: scale(1.2);
}

/* 轮播动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.carousel-slide {
    animation: fadeIn 0.8s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-content {
        text-align: left;
        padding: 2rem 1rem;
    }

    .hero-content h1 {
        font-size: 2.2rem;
        max-width: 100%;
    }

    .hero-content .hero-subtitle {
        font-size: 1.1rem;
        max-width: 100%;
    }

    .carousel-content {
        flex-direction: column;
        gap: 2rem;
        text-align: left;
    }

    .carousel-image {
        flex: 0 0 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .carousel-text {
        flex: 0 0 100%;
        text-align: left;
    }

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

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

