/* Layout-specific styles */

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Fallback background when video fails to load - pure gradient, no image */
    background: linear-gradient(135deg, rgba(5, 15, 30, 0.98) 0%, rgba(20, 40, 90, 0.9) 50%, rgba(5, 15, 30, 0.98) 100%);
    /* 确保容器稳定，避免内容变化时的跳动 */
    contain: layout style;
}

/* Animated gradient mesh overlay */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.1) 0%, transparent 60%);
    z-index: 1;
    animation: gradientMeshMove 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes gradientMeshMove {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }
    33% {
        transform: translate(30px, -30px) scale(1.05);
        opacity: 0.8;
    }
    66% {
        transform: translate(-30px, 30px) scale(0.95);
        opacity: 0.7;
    }
}

/* Page Header (for non-home pages) */
.page-header {
    padding: 120px 0 60px;
    min-height: 60vh; /* 占屏幕高度的1/2 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, rgba(5, 15, 30, 0.98) 0%, rgba(20, 40, 90, 0.9) 50%, rgba(5, 15, 30, 0.98) 100%);
    text-align: center;
    position: relative;
}

/* Page Header with Background Image */
.page-header-with-bg {
    padding: 120px 0 60px;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header-with-bg .bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.page-header-with-bg .bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.page-header-with-bg .bg-image.loaded {
    opacity: 1;
}

.page-header-with-bg .bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(5, 15, 30, 0.85) 0%, rgba(20, 40, 90, 0.75) 50%, rgba(5, 15, 30, 0.85) 100%);
    z-index: 1;
}

.page-header-with-bg .container {
    position: relative;
    z-index: 2;
}

/* Scroll indicator for all hero sections */
.page-header .scroll-indicator,
.page-header-with-bg .scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: scrollIndicatorFadeIn 1s ease-out 1.5s forwards;
    cursor: pointer;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, white, var(--bright-cyan), var(--electric-blue));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 6s ease-in-out infinite;
}

.page-subtitle {
    font-size: 1.375rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.6;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    z-index: 0;
    /* 添加加载时的背景，避免闪烁 */
    background: linear-gradient(135deg, rgba(5, 15, 30, 0.98) 0%, rgba(20, 40, 90, 0.9) 50%, rgba(5, 15, 30, 0.98) 100%);
    /* 初始透明度为1，避免页面切换时的透明度变化 */
    opacity: 1;
    /* 移除过渡效果，避免页面切换时的动画 */
    /* transition: opacity 0.3s ease-in-out; */
}

.hero-video.loaded {
    opacity: 1;
}

/* 移动端视频优化 - 通过CSS处理，避免JavaScript动态修改造成跳动 */
.hero-video.mobile-optimized {
    object-fit: contain !important;
    object-position: center center !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(5, 15, 30, 0.75), rgba(20, 40, 90, 0.6));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 1400px;
    padding: 0 var(--spacing-md);
    opacity: 0;
    transform: translateY(30px);
    animation: heroContentFadeIn 1.2s ease-out 0.3s forwards;
}

@keyframes heroContentFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 auto var(--spacing-md);
    line-height: 1.2;
    text-align: center;
}

/* Large screens - increase font size but keep it controlled */
@media (min-width: 1200px) {
    .hero-title {
        font-size: 3rem;
    }
}

@media (min-width: 1600px) {
    .hero-title {
        font-size: 3.2rem;
    }
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 1);
    max-width: 900px;
    margin: 0 auto var(--spacing-md);
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    animation: heroSubtitleFadeIn 1s ease-out 0.6s forwards;
}

@keyframes heroSubtitleFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: scrollIndicatorFadeIn 1s ease-out 1.5s forwards;
    cursor: pointer;
}

@keyframes scrollIndicatorFadeIn {
    to {
        opacity: 0.7;
    }
}

.scroll-indicator:hover {
    opacity: 1 !important;
}

.scroll-indicator-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.scroll-indicator-arrow {
    width: 24px;
    height: 24px;
    border: 2px solid var(--bright-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scrollArrowBounce 2s ease-in-out infinite;
}

.scroll-indicator-arrow svg {
    width: 12px;
    height: 12px;
    color: var(--bright-cyan);
}

@keyframes scrollArrowBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(8px);
    }
}

/* Sections */
.section {
    padding: var(--spacing-xl) 0;
}

.section-alt {
    background: rgba(30, 58, 138, 0.1);
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Stats Section */
.stats-section {
    padding: var(--spacing-xl) 0;
    background: rgba(30, 58, 138, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.stat-card {
    text-align: center;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(6, 182, 212, 0.2);
    backdrop-filter: blur(10px);
    transition: all var(--transition-slow);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s ease;
    border-radius: 50%;
}

.stat-card:hover {
    border-color: var(--bright-cyan);
    box-shadow: 
        0 10px 30px rgba(6, 182, 212, 0.2),
        0 0 40px rgba(59, 130, 246, 0.1);
}

.stat-card:hover::after {
    transform: translate(-50%, -50%) scale(3);
}

/* Tilt effect for stat cards */
.stat-card.tilt-enabled {
    transition: transform 0.1s ease-out;
}

.counter {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--bright-cyan), var(--electric-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
}

.stat-label {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: var(--spacing-xs);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.product-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: var(--spacing-md);
    border: 1px solid rgba(6, 182, 212, 0.2);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--bright-cyan), var(--electric-blue));
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.product-card:hover::before {
    transform: scaleX(1);
}

/* Tilt effect for product cards */
.product-card.tilt-enabled {
    transition: transform 0.1s ease-out;
}

.product-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--bright-cyan), var(--electric-blue));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
    transition: all 0.3s ease;
}

.product-card:hover .product-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4), 0 0 20px rgba(59, 130, 246, 0.3);
}

.product-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: white;
}

.product-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.product-features {
    list-style: none;
}

.product-features li {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--spacing-xs);
    padding-left: var(--spacing-md);
    position: relative;
}

.product-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--bright-cyan);
    font-weight: bold;
}

/* CTA Section */
.cta-section {
    padding: var(--spacing-xl) 0;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.2), rgba(6, 182, 212, 0.1));
    text-align: center;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.cta-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.cta-description {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

/* Footer */
.footer {
    background: rgba(10, 22, 40, 0.95);
    padding: 1.5rem 0 1rem; /* 减少页脚高度 */
    border-top: 1px solid rgba(6, 182, 212, 0.2);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    text-align: center;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bright-cyan);
    margin-bottom: var(--spacing-sm);
}

.footer-bottom {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.footer-bottom p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        height: 100vh; /* 全屏高度 */
        min-height: 100vh; /* 最小高度也是全屏 */
    }
    
    .hero-content {
        padding: 2rem 1rem; /* 减少内边距 */
    }
    
    .hero-title {
        font-size: 1.8rem; /* 稍微减小标题 */
        line-height: 1.2;
        margin-bottom: 1rem; /* 减少底部间距 */
    }
    
    .hero-subtitle {
        font-size: 1rem; /* 减小副标题 */
        margin-bottom: 1.5rem; /* 减少底部间距 */
        line-height: 1.4;
    }
    
    /* Hide scroll indicator on mobile */
    .scroll-indicator {
        display: none;
    }
    
    .stats-section {
        padding: 3rem 0; /* 减少统计部分的内边距 */
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem; /* 减少网格间距 */
    }
    
    .stat-card {
        padding: 1.5rem 1rem; /* 减少卡片内边距 */
    }
    
    .solutions-section {
        padding: 3rem 0; /* 减少解决方案部分的内边距 */
    }
    
    .solution-content {
        padding: 1.5rem 1rem; /* 减少内容内边距 */
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem; /* 减少产品网格间距 */
    }
    
    .section-title {
        font-size: 1.8rem; /* 减小章节标题 */
        margin-bottom: 2rem; /* 减少底部间距 */
    }
    
    .cta-title {
        font-size: 1.8rem; /* 减小 CTA 标题 */
    }
    
    .container {
        padding: 0 1rem; /* 减少容器内边距 */
    }
}

@media (max-width: 480px) {
    .hero {
        height: 80vh; /* 进一步减少 hero 高度 */
        min-height: 550px;
    }
    
    .hero-content {
        padding: 1.5rem 0.75rem; /* 更小的内边距 */
    }
    
    .hero-title {
        font-size: 1.6rem; /* 更小的标题 */
        margin-bottom: 0.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem; /* 更小的副标题 */
        margin-bottom: 1.25rem;
    }
    
    .stats-section {
        padding: 2.5rem 0; /* 更小的内边距 */
    }
    
    .stats-grid {
        gap: 0.75rem; /* 更小的间距 */
    }
    
    .stat-card {
        padding: 1.25rem 0.75rem; /* 更小的卡片内边距 */
    }
    
    .solutions-section {
        padding: 2.5rem 0; /* 更小的内边距 */
    }
    
    .solution-content {
        padding: 1.25rem 0.75rem; /* 更小的内容内边距 */
    }
    
    .section-title {
        font-size: 1.6rem; /* 更小的章节标题 */
        margin-bottom: 1.5rem;
    }
    
    .container {
        padding: 0 0.75rem; /* 更小的容器内边距 */
    }
    
    .hero-video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain; /* 显示完整视频，有边框也没关系 */
        object-position: center center;
        transform: none;
    }
}