/**
 * 首页：机械行业视觉、懒加载占位、缓慢入场动画
 */

body.hcn-home {
    background: #ececea;
}

/* 首屏加载淡入 */
body.hcn-home.hcn-home-loading .wp-site-blocks,
body.hcn-home.hcn-home-loading main {
    opacity: 0;
}

body.hcn-home.hcn-home-ready .wp-site-blocks,
body.hcn-home.hcn-home-ready main {
    opacity: 1;
    transition: opacity 0.65s ease;
}

/* 首屏 Hero */
body.hcn-home .wp-block-cover:first-of-type {
    min-height: 52vh !important;
    border-bottom: 4px solid #f47629;
}

body.hcn-home .wp-block-cover:first-of-type .wp-block-cover__inner-container {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s ease 0.15s, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
}

body.hcn-home.hcn-home-ready .wp-block-cover:first-of-type .wp-block-cover__inner-container {
    opacity: 1;
    transform: translateY(0);
}

body.hcn-home .wp-block-cover:first-of-type h1 {
    font-weight: 700 !important;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

body.hcn-home .wp-block-cover:first-of-type .wp-block-button__link {
    border-radius: 4px !important;
    font-weight: 600;
    padding: 12px 28px !important;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

body.hcn-home .wp-block-cover:first-of-type .is-style-fill .wp-block-button__link {
    background: #f47629 !important;
    border: 1px solid #f47629 !important;
    color: #fff !important;
}

body.hcn-home .wp-block-cover:first-of-type .is-style-fill .wp-block-button__link:hover {
    background: #d45f1a !important;
    transform: translateY(-2px);
}

body.hcn-home .wp-block-cover:first-of-type .is-style-outline .wp-block-button__link {
    border: 2px solid rgba(255, 255, 255, 0.9) !important;
    color: #fff !important;
    background: transparent !important;
}

body.hcn-home .wp-block-cover:first-of-type .is-style-outline .wp-block-button__link:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: #f47629 !important;
}

/* 区块标题机械感 */
body.hcn-home .wp-block-heading[style*="font-size:40px"],
body.hcn-home .wp-block-heading[style*="font-size: 40px"],
body.hcn-home h2.wp-block-heading,
body.hcn-home h3.wp-block-heading {
    color: #1a1d21;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
}

body.hcn-home .alignfull.has-background[style*="linear-gradient"] {
    background: linear-gradient(90deg, #ebebea 0%, #ebebea 38%, #ffffff 38%, #ffffff 100%) !important;
}

body.hcn-home .alignfull.has-contrast-light-background-color {
    background: #f4f4f2 !important;
}

/* 应用场景卡片 */
body.hcn-home .solutions-container {
    padding: 0 16px;
}

body.hcn-home .solution-card {
    border-radius: 4px !important;
    border-color: #d4d4d0 !important;
    box-shadow: 0 2px 10px rgba(26, 29, 33, 0.06);
}

body.hcn-home .solution-card::before {
    height: 3px;
    background: linear-gradient(90deg, #f47629, #2d3436);
}

body.hcn-home .solution-card:hover {
    border-color: #f47629 !important;
    box-shadow: 0 12px 28px rgba(244, 118, 41, 0.18);
}

/* 图片懒加载占位 */
body.hcn-home img.hcn-lazy,
body.hcn-home img[loading="lazy"] {
    background: linear-gradient(110deg, #e8e8e4 8%, #f5f5f3 18%, #e8e8e4 33%);
    background-size: 200% 100%;
}

body.hcn-home img.hcn-lazy.hcn-lazy-loading {
    animation: hcn-shimmer 1.4s ease-in-out infinite;
}

body.hcn-home img.hcn-lazy-loaded {
    animation: none;
    background: transparent;
}

@keyframes hcn-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

body.hcn-home .wp-block-image img {
    border-radius: 4px;
}

/* 缓慢滚动入场（首页加长过渡） */
body.hcn-home .scroll-animate {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

body.hcn-home .scroll-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

body.hcn-home .scroll-animate-from-left {
    transform: translateX(-48px);
}

body.hcn-home .scroll-animate-from-right {
    transform: translateX(48px);
}

body.hcn-home .scroll-animate-scale {
    transform: scale(0.94);
}

body.hcn-home .solution-card.scroll-animate {
    transform: translateY(24px) scale(0.97);
}

body.hcn-home .solution-card.scroll-animate.is-visible {
    transform: translateY(0) scale(1);
}

/* CTA 区域 */
body.hcn-home .cta-006 {
    position: relative;
    border-top: 4px solid #f47629;
}

body.hcn-home .cta-006::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(26, 29, 33, 0.55) 0%, rgba(26, 29, 33, 0.72) 100%);
    z-index: 0;
    pointer-events: none;
}

body.hcn-home .cta-006 > .wp-block-group {
    position: relative;
    z-index: 1;
}

/* 按钮统一 */
body.hcn-home .wp-block-button:not(.is-style-outline) .wp-block-button__link {
    background: #1a1d21 !important;
    border-radius: 4px !important;
    font-weight: 600;
}

body.hcn-home .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
    background: #2d3436 !important;
}

body.hcn-home .wp-block-button.is-style-outline .wp-block-button__link {
    border-radius: 4px !important;
    border-width: 2px !important;
}

@media (max-width: 781px) {
    body.hcn-home .wp-block-cover:first-of-type {
        min-height: 42vh !important;
    }

    body.hcn-home .wp-block-cover:first-of-type h1 {
        font-size: 32px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.hcn-home .scroll-animate,
    body.hcn-home .wp-block-cover:first-of-type .wp-block-cover__inner-container,
    body.hcn-home.hcn-home-ready .wp-site-blocks {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    body.hcn-home img.hcn-lazy.hcn-lazy-loading {
        animation: none;
    }
}
