/* ========================================
   订采云 - 数智供应链管理系统
   湖北弯道信息技术有限公司
   ======================================== */

/* 基础样式 */
* {
    scroll-behavior: smooth;
}

/* 渐变文字效果 */
.gradient-text {
    background: linear-gradient(135deg, #2563EB 0%, #06B6D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero 区域渐变背景 */
.hero-gradient {
    background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #0F172A 100%);
}

/* 玻璃态效果 */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(37, 99, 235, 0.25);
}

/* 浮动动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* 脉冲发光动画 */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(37, 99, 235, 0.6);
    }
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* 淡入上移动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* 滑入动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in {
    animation: slideIn 0.6s ease-out forwards;
}

/* 导航栏毛玻璃效果 */
.nav-blur {
    backdrop-filter: blur(20px);
    background: rgba(15, 23, 42, 0.8);
}

/* 移动端导航栏适配 - 延伸到安全区域（灵动岛/刘海屏） */
@media (max-width: 768px) {
    .nav-blur {
        background: #0F172A;
        /* 延伸到状态栏/灵动岛区域 */
        padding-top: env(safe-area-inset-top, 44px);
        /* 确保背景色覆盖整个顶部 */
        min-height: calc(60px + env(safe-area-inset-top, 44px));
    }
    
    /* 导航栏容器增加顶部内边距，内容避开状态栏 */
    nav .max-w-7xl {
        padding-top: max(0.5rem, env(safe-area-inset-top, 0));
    }
    
    /* 移动端菜单面板适配 */
    .mobile-menu {
        top: calc(73px + env(safe-area-inset-top, 0));
        height: calc(100% - 73px - env(safe-area-inset-top, 0));
    }
    
    /* Hero区域与导航栏无缝衔接 - 延伸到灵动岛 */
    #home {
        margin-top: calc(-1 * (4rem + env(safe-area-inset-top, 44px)));
        padding-top: calc(6rem + env(safe-area-inset-top, 44px)) !important;
        /* 背景延伸到顶部 */
        background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #0F172A 100%);
    }
    
    /* 确保Hero渐变背景延伸到顶部覆盖灵动岛区域 */
    #home::before {
        content: '';
        position: absolute;
        top: calc(-1 * env(safe-area-inset-top, 44px));
        left: 0;
        right: 0;
        height: env(safe-area-inset-top, 44px);
        background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 100%);
        z-index: -1;
    }
}

/* 流程图连接线动画 */
@keyframes dash {
    to {
        stroke-dashoffset: -20;
    }
}

.animate-dash {
    animation: dash 1s linear infinite;
}

/* 渐变边框效果 */
.gradient-border {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg, #2563EB 0%, #06B6D4 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* 数字滚动动画容器 */
.counter {
    font-variant-numeric: tabular-nums;
}

/* 移动端菜单 */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-menu.active {
    transform: translateX(0);
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1E293B;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748B;
}

/* ========================================
   移动端优化
   ======================================== */

/* 触摸优化 - 移除移动端hover效果，避免误触 */
@media (hover: none) and (pointer: coarse) {
    .card-hover:hover,
    .group:hover {
        transform: none !important;
    }
    
    /* 移动端点击反馈 */
    .card-hover:active,
    .group:active {
        transform: scale(0.98) !important;
        transition: transform 0.1s ease !important;
    }
}

/* 移动端动画简化 - 减少性能消耗 */
@media (max-width: 768px) {
    .animate-float {
        animation: none;
    }
    
    .animate-fade-in,
    .animate-slide-in {
        animation-duration: 0.4s;
    }
    
    /* 移动端减少阴影，提升性能 */
    .glass {
        backdrop-filter: blur(8px);
    }
    
    /* 移动端减小脉冲动画强度 */
    .animate-pulse-glow {
        animation: none;
    }
}

/* 小屏手机额外优化 */
@media (max-width: 375px) {
    /* 超小屏幕进一步简化 */
    .animate-fade-in,
    .animate-slide-in {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ========================================
   核心架构与业务流程动效
   ======================================== */

/* 交错淡入动画 */
@keyframes staggerFadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-stagger {
    opacity: 0;
    animation: staggerFadeInUp 0.6s ease-out forwards;
}

.animate-stagger-1 { animation-delay: 0.1s; }
.animate-stagger-2 { animation-delay: 0.2s; }
.animate-stagger-3 { animation-delay: 0.3s; }
.animate-stagger-4 { animation-delay: 0.4s; }
.animate-stagger-5 { animation-delay: 0.5s; }
.animate-stagger-6 { animation-delay: 0.6s; }

/* 流程步骤依次显示动画 */
@keyframes stepReveal {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-step {
    opacity: 0;
    animation: stepReveal 0.5s ease-out forwards;
}

/* 箭头脉冲动效 */
@keyframes arrowPulse {
    0%, 100% {
        opacity: 0.4;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(5px);
    }
}

.animate-arrow {
    animation: arrowPulse 1.5s ease-in-out infinite;
}

/* 卡片光晕扫过效果 */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.card-shimmer {
    position: relative;
    overflow: hidden;
}

.card-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

/* 图标弹跳动画 */
@keyframes iconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.animate-icon-bounce {
    animation: iconBounce 2s ease-in-out infinite;
}

/* 数字递增动画 */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-count {
    animation: countUp 0.8s ease-out forwards;
}

/* 悬停缩放效果 */
.hover-scale {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* 流程连接线流动效果 */
@keyframes flowLine {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.animate-flow-line {
    stroke-dasharray: 10, 5;
    animation: flowLine 2s linear infinite;
}

/* 滚动触发显示类（配合JS使用） */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* 移动端简化动效 */
@media (max-width: 768px) {
    .animate-stagger,
    .animate-step {
        animation-duration: 0.4s;
    }
    
    .card-shimmer::after {
        animation: none;
    }
}
