/**
 * HelloHub 自定义样式
 * 简洁专业 + 微妙视觉增强
 */

/* 字体设置 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* 性能优化：移除渐变，使用纯色 */
    background: #ffffff;
    /* 性能优化：启用 GPU 加速 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Swiss 网格系统 */
.swiss-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 焦点可见性 - 无障碍 */
:focus-visible {
    outline: 2px solid #111827;
    outline-offset: 2px;
}

/* === 优雅卡片悬停效果 === */

/* 卡片基础样式 */
.card-hover {
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    /* 性能优化：启用 GPU 加速 */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* 卡片过渡 - 性能优化版本 */
.card-hover,
.card-hover.fade-in-up,
.card-hover.fade-in-up.visible {
    /* 性能优化：只对 transform 应用过渡 */
    transition: transform 0.3s ease-out !important;
}

/* 悬停时的优雅效果 - 性能优化版本 */
.card-hover:hover {
    /* 微妙上浮 - 只有 2px */
    transform: translateY(-2px) translateZ(0) !important;
    /* 性能优化：简化阴影 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* 渐变文字 */
.gradient-text {
    background: linear-gradient(135deg, #111827 0%, #4B5563 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero 区域光晕背景特效 */
.hero-pattern {
    position: relative;
    background: #ffffff;
    /* 性能优化：启用 GPU 加速 */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* 背景光晕层 - 性能优化版本 */
.hero-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    /* 性能优化：简化为单层渐变，大幅减少渲染开销 */
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    pointer-events: none;
    z-index: 0;
    /* 性能优化：固定定位避免重绘 */
    position: fixed;
}

/* 确保内容在背景层之上 */
.hero-pattern > * {
    position: relative;
    z-index: 1;
}

/* 数字计数动画 */
@keyframes count-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-number {
    animation: count-up 0.6s ease-out forwards;
}

/* === 滚动触发动画 === */

/* 动画初始状态 - 隐藏并下移 */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* 动画激活状态 - 显示并恢复位置 */
.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 淡入动画（无位移） */
.fade-in {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.fade-in.visible {
    opacity: 1;
}

/* 左侧滑入动画 */
.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* 右侧滑入动画 */
.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* 缩放淡入动画 */
.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    /* 禁用滚动动画 */
    .fade-in-up,
    .fade-in,
    .fade-in-left,
    .fade-in-right,
    .scale-in {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* === 优化样式 === */

/* 副标题增强对比度 - 提升可读性 */
.hero-description {
    color: #4B5563; /* 深灰色，比 gray-600 更清晰 */
    font-weight: 400;
    line-height: 1.7;
}

/* 卡片数字渐变突出 - 视觉重点 */
.card-highlight-number {
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

/* 浮动卡片 - 性能优化版本 */
.float-card {
    /* 性能优化：只对 transform 应用过渡 */
    transition: transform 0.3s ease-out;
    /* 性能优化：启用 GPU 加速 */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.float-card:hover {
    transform: translateY(-4px) translateZ(0);
    /* 性能优化：简化阴影 */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* 图标容器旋转效果 - 性能优化版本 */
.float-card:hover .icon-container {
    /* 性能优化：只用 transform */
    transform: rotate(5deg) translateZ(0);
}

.icon-container {
    /* 性能优化：只对 transform 应用过渡 */
    transition: transform 0.3s ease-out;
    /* 性能优化：启用 GPU 加速 */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* === 导航栏样式 === */

/* 确保导航栏固定定位 */
nav {
    /* 不覆盖 position，让 Tailwind 的 fixed 生效 */
}

/* 导航栏滚动状态 - 性能优化版本 */
nav.scrolled {
    /* 性能优化：使用半透明纯色代替模糊效果 */
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(229, 231, 235, 0.8) !important;
    /* 性能优化：简化阴影 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    /* 性能优化：启用 GPU 加速 */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* 导航栏底部描边 - 性能优化版本 */
nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    /* 性能优化：使用纯色代替渐变 */
    background: rgba(0, 0, 0, 0.06);
}

/* 导航链接下划线动画 - 性能优化版本 */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #111827;
    /* 性能优化：只对 width 和 opacity 应用过渡 */
    transition: width 0.3s ease;
    /* 性能优化：启用 GPU 加速 */
    will-change: width;
}

.nav-link:hover::after {
    width: 100%;
}

/* 汉堡菜单按钮 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #111827;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
}

/* 汉堡菜单动画状态 */
.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* 移动端菜单 */
.mobile-menu {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #f3f4f6;
    padding: 1rem 0;
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 40;
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
}

.mobile-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #6b7280;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.mobile-menu a:hover {
    color: #111827;
}

/* 移动端响应式 */
@media (max-width: 767px) {
    .mobile-menu-btn {
        display: flex;
    }

    .mobile-menu {
        display: block;
    }
}
