/* 自定义CSS，用于补充Tailwind CSS无法满足的样式 */ 

/* 页面加载动画 */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 107, 107, 0.2);
    border-radius: 50%;
    border-top-color: #FF6B6B;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 轮播图样式 */
.carousel-item {
    transition: opacity 0.7s ease;
    will-change: opacity;
}

.carousel-dot {
    transition: opacity 0.3s ease, background-color 0.3s ease;
    will-change: opacity, background-color;
}

.carousel-dot.active,
.carousel-dot:hover {
    opacity: 1 !important;
    background-color: #FF6B6B !important;
}

/* 轮播图按钮动画 */
#prevBtn, #nextBtn {
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#prevBtn:hover, #nextBtn:hover {
    transform: scale(1.1);
}

#prevBtn:active, #nextBtn:active {
    transform: scale(0.95);
}

/* 轮播图文字渐入效果 */
.carousel-item h2,
.carousel-item p {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.carousel-item.opacity-100 h2 {
    opacity: 1;
    transform: translateY(0);
}

.carousel-item.opacity-100 p {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

/* 图片悬停效果 */
.img-hover-zoom {
    overflow: hidden;
}

.img-hover-zoom img {
    transition: transform 0.5s ease;
}

.img-hover-zoom:hover img {
    transform: scale(1.05);
}

/* 动态出现效果 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 导航栏相关样式 */
.nav-shadow {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 确保导航栏固定在顶部 */
nav.fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 50;
    transition: box-shadow 0.3s ease;
}

/* 为内容区域添加足够的顶部内边距，防止被固定导航栏遮挡 */
main {
    padding-top: 60px;
}

/* 语言切换下拉菜单 */
.language-dropdown:hover .language-dropdown-menu {
    display: block;
}

/* 移动菜单过渡效果 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#mobile-menu:not(.hidden) {
    animation: slideDown 0.3s ease forwards;
}

/* 当前激活的导航项 */
.nav-link.active {
    color: #FF6B6B;
    font-weight: 600;
}

/* 暗色模式切换按钮 */
.theme-toggle {
    position: relative;
    width: 40px;
    height: 20px;
    background-color: #e2e8f0;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.theme-toggle.dark {
    background-color: #4a5568;
}

.theme-toggle::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.theme-toggle.dark::after {
    transform: translateX(20px);
}

/* 关于我们区域样式 */
#about img {
    filter: brightness(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition: transform 0.6s ease, filter 0.6s ease;
}

#about img:hover {
    filter: brightness(1.05);
}

#about .relative::after {
    content: '';
    position: absolute;
    top: 15px;
    right: 15px;
    bottom: 15px;
    left: 15px;
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 0.5rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#about .relative:hover::after {
    opacity: 1;
}

/* 列表项动画 */
#about ul li {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#about ul li:nth-child(1) {
    transition-delay: 0.1s;
}

#about ul li:nth-child(2) {
    transition-delay: 0.2s;
}

#about ul li:nth-child(3) {
    transition-delay: 0.3s;
}

#about.in-view ul li {
    opacity: 1;
    transform: translateX(0);
}

/* 数据亮点动画 */
#about .grid > div {
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

#about .grid > div:nth-child(1) {
    transition-delay: 0.2s;
}

#about .grid > div:nth-child(2) {
    transition-delay: 0.4s;
}

#about.in-view .grid > div {
    transform: translateY(0);
    opacity: 1;
}

/* 产品卡片样式 */
.product-card {
    backface-visibility: hidden;
    transform: translateZ(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card img {
    transition: transform 0.5s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

/* 产品卡片动画效果 */
#products .product-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#products.in-view .product-card {
    opacity: 1;
    transform: translateY(0);
}

#products.in-view .product-card:nth-child(1) {
    transition-delay: 0.1s;
}

#products.in-view .product-card:nth-child(2) {
    transition-delay: 0.2s;
}

#products.in-view .product-card:nth-child(3) {
    transition-delay: 0.3s;
}

#products.in-view .product-card:nth-child(4) {
    transition-delay: 0.4s;
}

#products.in-view .product-card:nth-child(5) {
    transition-delay: 0.5s;
}

#products.in-view .product-card:nth-child(6) {
    transition-delay: 0.6s;
}

/* 合作品牌Logo墙样式 */
.partner-logo {
    opacity: 0;
    transform: translateY(10px);
    transition: transform 0.4s ease, opacity 0.4s ease, box-shadow 0.3s ease;
}

#partners.in-view .partner-logo {
    opacity: 1;
    transform: translateY(0);
}

/* 为Logo添加延迟动画 */
#partners.in-view .partner-logo:nth-child(1) { transition-delay: 0.1s; }
#partners.in-view .partner-logo:nth-child(2) { transition-delay: 0.15s; }
#partners.in-view .partner-logo:nth-child(3) { transition-delay: 0.2s; }
#partners.in-view .partner-logo:nth-child(4) { transition-delay: 0.25s; }
#partners.in-view .partner-logo:nth-child(5) { transition-delay: 0.3s; }
#partners.in-view .partner-logo:nth-child(6) { transition-delay: 0.35s; }
#partners.in-view .partner-logo:nth-child(7) { transition-delay: 0.4s; }
#partners.in-view .partner-logo:nth-child(8) { transition-delay: 0.45s; }
#partners.in-view .partner-logo:nth-child(9) { transition-delay: 0.5s; }
#partners.in-view .partner-logo:nth-child(10) { transition-delay: 0.55s; }

/* 为Logo添加悬停效果 */
.partner-logo:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 确保在暗色模式下Logo清晰可见 */
.partner-logo img {
    transition: filter 0.3s ease, transform 0.3s ease;
}

.partner-logo:hover img {
    transform: scale(1.05);
}

/* 联系我们区域样式 */
#contact .bg-white,
#contact .bg-gray-900 {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#contact .bg-white:hover,
#contact .bg-gray-900:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 联系我们表单样式 */
#contact input,
#contact textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#contact input:focus,
#contact textarea:focus {
    border-color: #FF6B6B;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

/* 联系方式图标样式 */
#contact .flex-shrink-0 {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

#contact .flex-shrink-0:hover {
    transform: scale(1.1);
    background-color: rgba(255, 107, 107, 0.2);
}

/* 联系我们部分的动画效果 */
#contact.in-view .order-2 {
    animation: slideUp 0.6s ease forwards;
}

#contact.in-view .order-1 > div:first-child {
    animation: slideDown 0.6s ease forwards;
}

#contact.in-view .order-1 > div:last-child {
    animation: slideDown 0.6s 0.2s ease forwards;
}

/* 确保在加载时表单和信息是隐藏的 */
#contact:not(.in-view) .order-1 > div,
#contact:not(.in-view) .order-2 {
    opacity: 0;
    transform: translateY(30px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 社交媒体图标特效 */
#contact .social-icons a {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

#contact .social-icons a:hover {
    transform: translateY(-3px);
    background-color: rgba(255, 107, 107, 0.2);
}

/* 提交按钮特效 */
#contact button[type="submit"] {
    transition: transform 0.3s ease, background-color 0.3s ease;
    overflow: hidden;
    position: relative;
}

#contact button[type="submit"]:hover {
    transform: translateY(-2px);
}

#contact button[type="submit"]:active {
    transform: translateY(0);
}

/* 页脚样式 */
footer {
    position: relative;
}

footer .social-icons a {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

footer .social-icons a:hover {
    transform: translateY(-3px);
    background-color: rgba(255, 107, 107, 0.2);
}

footer ul li a {
    position: relative;
    display: inline-block;
}

footer ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: #FF6B6B;
    transition: width 0.3s ease;
}

footer ul li a:hover::after {
    width: 100%;
}

/* 添加页脚内容淡入效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

footer .grid > div {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

footer .grid > div:nth-child(1) {
    animation-delay: 0.1s;
}

footer .grid > div:nth-child(2) {
    animation-delay: 0.3s;
}

footer .grid > div:nth-child(3) {
    animation-delay: 0.5s;
}

/* 版权信息动画 */
footer .border-t {
    animation: fadeInUp 0.8s ease 0.7s forwards;
    opacity: 0;
} 