/* 基础样式 */
html {
    scroll-behavior: smooth;
}

/* 轮播图样式 */
#carousel {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
    will-change: transform;
}

.carousel-item {
    min-width: 100%;
    width: 100%; /* 明确设置宽度 */
    flex-shrink: 0;
    height: 100%;
    background-size: cover; /* 确保背景图覆盖整个区域 */
    background-position: center;
}

/* 确保控制按钮在最上层 */
#prev-slide, #next-slide {
    z-index: 20;
    background-color: rgba(0,0,0,0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
    outline: none;
    cursor: pointer;
}

/* 指示器样式 */
.carousel-indicator {
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.carousel-indicator.active {
    opacity: 1 !important;
}
#menu-language {
    font-size: 1rem;
    margin-right: 1.5rem;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 导航栏滚动效果 */
.navbar-scrolled {
    background-color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 导航栏链接颜色 */
.nav-link {
    color: white !important;
}

.nav-link:hover {
    color: #e0e0e0 !important; /* 浅灰色，与绿色背景有足够对比度 */
}

/* 导航栏滚动时的链接颜色 */
.navbar-scrolled .nav-link {
    color: #212121 !important;
}

.navbar-scrolled .nav-link:hover {
    color: #2E7D32 !important; /* 滚动时背景是白色，绿色文字清晰可见 */
}

/* 导航栏滚动时的移动端菜单按钮颜色 */
.navbar-scrolled #menu-toggle {
    color: #212121 !important;
}

/* 自定义工具类 */
.content-auto {
    content-visibility: auto;
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.transition-custom {
    transition: all 0.3s ease-in-out;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.8s ease-in-out;
}

.slide-up {
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 卡片悬停效果增强 */
.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px -10px rgba(0, 0, 0, 0.1);
}

/* 按钮悬停效果 */
.btn-primary {
    background-color: #1976D2;
    color: white;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #0D47A1;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: #1565C0;
    color: white;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #0D47A1;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 图片悬停效果 */
.img-hover {
    transition: transform 0.5s ease;
}

.img-hover:hover {
    transform: scale(1.03);
}

/* 平滑滚动到锚点 */
html {
    scroll-behavior: smooth;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }

    .text-[clamp(1.5rem,3vw,2.5rem)] {
        font-size: 1.8rem;
    }

    .text-[clamp(2rem,5vw,4rem)] {
        font-size: 2.5rem;
    }

    /* 移动端轮播图箭头优化 */
    #prev-slide,
    #next-slide {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    #prev-slide {
        left: 8px;
    }

    #next-slide {
        right: 8px;
    }
}

@media (max-width: 480px) {
    .text-[clamp(1.5rem,3vw,2.5rem)] {
        font-size: 1.5rem;
    }

    .text-[clamp(2rem,5vw,4rem)] {
        font-size: 2rem;
    }

    /* 更小屏幕的箭头优化 */
    #prev-slide,
    #next-slide {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        background-color: rgba(0,0,0,0.4);
    }

    #prev-slide {
        left: 5px;
    }

    #next-slide {
        right: 5px;
    }

    /* 确保文字不被遮挡 */
    .carousel-item .container {
        padding-left: 50px;
        padding-right: 50px;
    }
}

/* 加载动画 */
.loader {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #1976D2;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 表单样式 */
.form-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.75rem;
    width: 100%;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    border-color: #1976D2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

/* 页脚链接样式 */
.footer-link {
    color: #9e9e9e;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #1976D2;
}