/* 全局变量定义 */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #fff;
    --accent-color: #555;
    --transition-time: 0.3s;
    --footer-text-color: #999;
    --gradient-start: #ffffff;
    --gradient-end: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.08);
    --card-hover-shadow: rgba(0, 0, 0, 0.12);
    --accent-gradient: linear-gradient(45deg, #1a1a1a, #333);
    --title-glow: rgba(26, 26, 26, 0.3);
}

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 字体预加载 */
@font-face {
    font-family: 'system-ui';
    font-weight: 500;
    font-display: block;
    src: local('system-ui');
}

body {
    overflow-x: hidden;
}

/* 主体内容样式 */
.main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
    opacity: 1;
}

.main-content.transitioning-out {
    transform: translateX(-30px);
    opacity: 0;
}

.main-content.transitioning-in {
    transform: translateX(30px);
    opacity: 0;
}

.main-content.transition-reset {
    transform: translateX(0);
    opacity: 1;
}

/* 页面过渡效果 */
.main-content.transitioning {
    animation: pageTransition 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pageTransition {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-30px);
        opacity: 0;
    }
}

/* 英雄区块样式 */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
    padding: 2rem;
    text-align: center;
    position: relative;
}

.hero-content {
    max-width: 800px;
    will-change: opacity, transform;
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
    animation-delay: 0.1s;
    padding: 2rem;
}

/* 预加载样式，防止闪烁 */
.hero-content {
    will-change: opacity, transform;
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
    animation-delay: 0.1s;
}

/* 标题样式优化 */
.animate-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 500;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.01em;
    position: relative;
    display: inline-block;
    cursor: default;
    /* 增强立体感的多层阴影效果 */
    text-shadow: 
        0 1px 1px rgba(0, 0, 0, 0.1),
        0 2px 2px rgba(0, 0, 0, 0.1),
        0 4px 4px rgba(0, 0, 0, 0.1),
        0 8px 8px rgba(0, 0, 0, 0.1),
        0 16px 16px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    will-change: opacity, transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    visibility: hidden;
}

/* 标题可见类 */
.animate-title.ready {
    visibility: visible;
    opacity: 0;
}

.animate-title.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* 添加持续浮动效果 */
.animate-title.floating {
    animation: titleFloat 6s ease-in-out infinite;
}

/* 添加伪元素实现光效 */
.animate-title::before {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        transparent 0%,
        rgba(255, 255, 255, 0.1) 45%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0.1) 55%,
        transparent 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    z-index: 1;
    animation: lightEffect 4s linear infinite;
}

/* 添加光效动画 */
@keyframes lightEffect {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* 更新浮动动画，使其更加缓慢平滑 */
@keyframes titleFloat {
    0%, 100% {
        transform: translateY(0);
        text-shadow: 
            0 1px 1px rgba(0, 0, 0, 0.1),
            0 2px 2px rgba(0, 0, 0, 0.1),
            0 4px 4px rgba(0, 0, 0, 0.1),
            0 8px 8px rgba(0, 0, 0, 0.1),
            0 16px 16px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: translateY(-8px);
        text-shadow: 
            0 2px 2px rgba(0, 0, 0, 0.1),
            0 4px 4px rgba(0, 0, 0, 0.1),
            0 8px 8px rgba(0, 0, 0, 0.1),
            0 16px 16px rgba(0, 0, 0, 0.1),
            0 32px 32px rgba(0, 0, 0, 0.1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 副标题容器样式 */
.animate-subtitle-container {
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

/* 副标题部分样式 */
.animate-subtitle-part {
    font-size: clamp(1rem, 4vw, 1.5rem);
    color: var(--accent-color);
    margin: 0.5rem 0;
    position: relative;
    display: inline-block;
    padding: 0.2rem 1.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: subtitleReveal 0.8s ease-out forwards, textWave 3s ease-in-out infinite;
    animation-delay: var(--reveal-delay, 0s), var(--wave-delay, 0s);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 4px 8px rgba(0, 0, 0, 0.02);
    background: linear-gradient(90deg, 
        rgba(245, 245, 245, 0.8) 0%,
        rgba(250, 250, 250, 1) 50%,
        rgba(245, 245, 245, 0.8) 100%
    );
    will-change: transform;
}

/* 为每个副标题设置不同的动画延迟 */
.animate-subtitle-part:nth-child(1) {
    --reveal-delay: 0.3s;
    --wave-delay: 0s;
}

.animate-subtitle-part:nth-child(2) {
    --reveal-delay: 0.5s;
    --wave-delay: 0.2s;
}

.animate-subtitle-part:nth-child(3) {
    --reveal-delay: 0.7s;
    --wave-delay: 0.4s;
}

/* 文字波浪动画 */
@keyframes textWave {
    0% {
        transform: scale(1);
    }
    15% {
        transform: scale(1.05);
    }
    30% {
        transform: scale(1);
    }
    100% {
        transform: scale(1);
    }
}

/* 副标题显示动画 */
@keyframes subtitleReveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 鼠标悬停效果 */
.animate-subtitle-part:hover {
    transform: translateX(5px);
    color: var(--primary-color);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.06),
        0 8px 16px rgba(0, 0, 0, 0.06);
    background: linear-gradient(90deg, 
        rgba(240, 240, 240, 0.9) 0%,
        rgba(248, 248, 248, 1) 50%,
        rgba(240, 240, 240, 0.9) 100%
    );
}

/* 移除原有的animate-subtitle类 */
.animate-subtitle {
    display: none;
}

/* 按钮样式优化 */
.cta-button {
    display: inline-flex;
    align-items: center;
    padding: 1.2rem 3rem;
    background: var(--primary-color);
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 50px;
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    white-space: nowrap;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.8s;
    box-shadow: 0 4px 15px var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--card-hover-shadow);
    padding-right: 3.5rem;
}

.cta-button:hover::before {
    left: 100%;
}

.arrow {
    width: 20px;
    height: 20px;
    margin-left: 8px;
    fill: var(--secondary-color);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    right: 1.5rem;
}

.cta-button:hover .arrow {
    opacity: 1;
    transform: translateX(0);
}

/* 功能展示区样式优化 */
.features-section {
    background: var(--gradient-start);
    color: var(--primary-color);
    padding: 8rem 2rem;
    position: relative;
    margin-top: -1px;
    perspective: 1000px; /* 添加3D视角 */
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    position: relative;
    z-index: 2;
}

.feature-card {
    text-align: center;
    padding: 3rem 2rem;
    border-radius: 20px;
    background: var(--secondary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1),
                0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(30px);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12),
                0 15px 25px rgba(0, 0, 0, 0.08);
}

.feature-card:hover::before {
    transform: translateX(100%);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    padding: 1.2rem;
    border-radius: 50%;
    background: var(--gradient-start);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.feature-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--primary-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover .feature-icon svg {
    transform: scale(1.1);
    fill: #000;
}

.feature-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    visibility: hidden;
    opacity: 0;
}

.feature-card.fonts-loaded h3 {
    visibility: visible;
    opacity: 1;
}

.feature-card:hover h3 {
    transform: translateY(-3px);
    color: #000;
}

.feature-card p {
    color: var(--accent-color);
    line-height: 1.8;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.feature-card:hover p {
    transform: translateY(-2px);
    color: #333;
}

/* 底部样式优化 */
#footer {
    background: var(--secondary-color);
    padding: 40px 20px;
    text-align: center;
    margin-top: auto;
    margin-bottom: 0 !important;
    position: relative;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

#footer::before {
    display: none;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.copyright-section, .security-section {
    font-size: 12px;
    line-height: 1.5;
    color: var(--footer-text-color);
}

.copyright-section {
    margin-bottom: 10px;
}

.copyright {
    margin: 6px 0;
}

.copyright img, .security-section img {
    vertical-align: middle;
    margin-right: 5px;
}

.copyright a, .security-section a {
    color: var(--footer-text-color);
    text-decoration: none;
    transition: color var(--transition-time);
}

.copyright a:hover, .security-section a:hover {
    color: var(--primary-color);
}

/* 动画关键帧优化 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    .hero-section {
        padding: 1.5rem;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    .features-section {
        padding: 4rem 1rem;
    }
    
    .features-container {
        gap: 2rem;
        padding: 0 1rem;
    }

    .feature-card {
        padding: 2rem 1.5rem;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08),
                    0 3px 10px rgba(0, 0, 0, 0.04);
    }

    .feature-card:hover {
        transform: translateY(-6px) scale(1.01);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1),
                    0 10px 20px rgba(0, 0, 0, 0.06);
    }

    .cta-button {
        padding: 1rem 2.5rem;
    }

    .cta-button:hover {
        padding-right: 3rem;
    }
}

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

/* 添加卡片动画关键帧 */
@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    60% {
        transform: translateY(-7px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 添加微光动画 */
@keyframes subtleGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}