/* 科技感设计核心样式 */

/* 全局动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 滚动动画 */
.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.float {
    animation: float 3s ease-in-out infinite;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* 渐变背景动画 */
.gradient-animate {
    background-size: 200% 200%;
    animation: gradientMove 15s ease infinite;
}

/* 导航栏滚动效果 */
header.scrolled {
    padding-top: 10px;
    padding-bottom: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 重置轮播组件样式 - 简化方案 */
#showcase {
    position: relative;
    width: 100%;
    overflow: visible;
}

/* 重置容器样式，移除所有可能的限制 */
#showcase .container {
    padding-left: 0;
    padding-right: 0;
    overflow: visible;
}

/* 移除轮播图外部容器的定位限制 */
#showcase .relative {
    position: static;
    width: 100%;
    margin: 0;
    overflow: visible;
}

/* 横向滚动容器 - 简化设计 */
#carousel-scroll-container {
    width: 100%;
    overflow-x: auto;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-bottom: 20px;
}

/* 隐藏滚动条 */
#carousel-scroll-container::-webkit-scrollbar {
    display: none;
}

/* 轮播内容包装器 - 关键修复 */
#carousel-wrapper {
    display: flex;
    gap: 24px;
    padding-right: 160px; /* 极大增加右侧空间，确保最后一个元素完全可见 */
    padding-left: 16px; /* 为左侧按钮留出空间 */
    width: max-content;
    box-sizing: border-box;
}

/* 调整轮播控制按钮定位 */
#scroll-left {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    margin-left: 8px;
}

#scroll-right {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    margin-right: 8px;
}

/* 轮播项悬停效果增强 */
#showcase .w-80, #showcase .w-96 {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#showcase .w-80:hover, #showcase .w-96:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#showcase img {
    transition: transform 0.6s ease;
}

#showcase .w-80:hover img, #showcase .w-96:hover img {
    transform: scale(1.1);
}

/* 轮播控制按钮样式 */
#scroll-left, #scroll-right {
    opacity: 0.8;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#scroll-left:hover, #scroll-right:hover {
    opacity: 1;
    transform: scale(1.1) translateY(-50%);
}

/* 科技背景线条装饰 */
.tech-lines {
    position: relative;
    overflow: hidden;
}

.tech-lines::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(to right, rgba(2, 132, 199, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(2, 132, 199, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

/* 特点卡片动画 */
#features .grid > div {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#features .grid > div:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#features .grid > div:hover .w-14 {
    background-color: rgba(2, 132, 199, 0.2);
    transform: scale(1.1);
}

#features .w-14 {
    transition: all 0.3s ease;
}

/* 解决方案卡片悬停效果 */
#solutions .bg-gray-50 {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#solutions .bg-gray-50:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#solutions img {
    transition: transform 0.5s ease;
}

#solutions .bg-gray-50:hover img {
    transform: scale(1.05);
}

/* 按钮悬停效果增强 */
button, a.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

button::after, a.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

button:focus:not(:active)::after, a.btn:focus:not(:active)::after {
    animation: ripple 0.5s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* 表单输入框焦点效果 */
input:focus, textarea:focus {
    transition: all 0.3s ease;
}

/* 移动菜单动画 */
#mobile-menu {
    transition: all 0.3s ease-in-out;
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
}

#mobile-menu.show {
    transform: scaleY(1);
    opacity: 1;
}

/* 数字计数器动画 */
.count-up {
    transition: all 1s ease;
}

/* 加载动画 */
.loader {
    border: 3px solid rgba(2, 132, 199, 0.3);
    border-radius: 50%;
    border-top: 3px solid #0284c7;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计优化 */
@media (max-width: 1200px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 992px) {
    .nav-links {
        display: none;
    }
    .mobile-menu-btn {
        display: block;
    }
    #features .grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    #features .grid {
        grid-template-columns: 1fr;
    }
    
    #solutions .grid {
        grid-template-columns: 1fr;
    }
    
    #contact .grid {
        grid-template-columns: 1fr;
    }
    
    #showcase .w-80, #showcase .w-96 {
        width: 90vw;
        max-width: 300px;
    }
    
    #scroll-left, #scroll-right {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    /* 系统介绍模块响应式 */
    .grid-cols-1.md\:grid-cols-3.gap-6 {
        grid-template-columns: 1fr;
    }
    .flex.flex-col.lg\:flex-row.items-center.gap-12 {
        flex-direction: column;
        gap: 60px;
    }
    .hidden.md\:block {
        display: none;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* 优化移动端触摸目标大小 */
    a, button {
        min-height: 48px;
        min-width: 48px;
    }
    
    /* 移动端增强可读性 */
    body {
        font-size: 16px;
    }
    p {
        line-height: 1.6;
    }
}

/* 交互效果增强 */
/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 触摸反馈 */
button, a, .carousel-item {
    touch-action: manipulation;
}

/* 焦点状态样式 */
button:focus,
input:focus,
textarea:focus,
a:focus {
    outline: 2px solid var(--primary, #0284c7);
    outline-offset: 2px;
}

/* 减少点击延迟 */
@media (hover: none) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .bg-primary {
        background-color: #0066cc;
    }
    
    .text-primary {
        color: #0066cc;
    }
}

/* 减少动画偏好设置 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 打印样式 */
@media print {
    header,
    nav,
    footer,
    #scroll-left,
    #scroll-right {
        display: none;
    }
    
    section {
        page-break-inside: avoid;
    }
    
    body {
        background: white;
        color: black;
    }
}