/* --- Hero Section --- */
.hero {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    height: 100%;
    width: 100%;
    padding-left: 20%;
    max-width: 100%;
}

.hero-text {
    max-width: 550px;
    position: relative;
    z-index: 3;
}

.hero-text h1 {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--color-primary);
}

.hero-text .highlight {
    color: var(--color-accent);
    background: -webkit-linear-gradient(45deg, #1168eb, #09de9c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text p {
    font-size: 22px;
    color: var(--color-text-light);
    margin-bottom: 30px;
    max-width: 500px;
}

.hero-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    background-color: var(--color-bg);
}

.hero-bg-asset {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 0.8s ease;
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

.hero-bg-asset.loaded {
    opacity: 1;
}

/* --- product --- */
.ecosystem {
    padding: 100px 0;
    background-color: var(--color-bg);
    overflow: visible;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
    letter-spacing: -0.5px;
}

.section-title h2 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--color-primary);
}

.section-title .label {
    display: inline-block;
    color: var(--color-accent);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.section-title p {
    font-size: 18px;
    color: #4b5563;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.eco-3d-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 100px 80px;
    padding-top: 80px;
}

.eco-card {
    position: relative;
    background: #ffffff;
    border-radius: 24px;
    padding: 32px;
    min-height: 260px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    overflow: visible;
}

.eco-bg {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    z-index: 0;
}

.eco-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.eco-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 43, 73, 0.85) 0%, rgba(0, 0, 0, 0.2) 60%);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.eco-info {
    width: 50%;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.eco-info h3 {
    font-size: 26px;
    font-weight: 700;
    color: #002B49;
    margin-bottom: 16px;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-origin: left top;
}

.eco-info p {
    color: #64748b;
    font-size: 16px;
    line-height: 1.6;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.eco-visual {
    position: absolute;
    top: -64px;
    right: -40px;
    width: 259px;
    height: 259px;
    z-index: 20;
    pointer-events: none;
    overflow: visible;
}

.eco-visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 45px 45px rgba(0, 0, 0, 0.18));
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* --- R&D Section --- */
.section-padding {
    padding: 100px 0;
}

.rd {
    position: relative;
    background-color: var(--color-primary);
    color: var(--color-white);
    overflow: hidden;
}

.rd-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(99, 231, 190, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 10% 80%, rgba(99, 231, 190, 0.1) 0%, transparent 40%);
    z-index: 1;
}

.rd-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.rd-text h2 {
    font-size: 36px;
    line-height: 1.2;
    margin-bottom: 30px;
    font-weight: 800;
}

.rd-text h2 span {
    color: var(--color-accent);
}

.rd-text p {
    font-size: 18px;
    color: #94a3b8;
    margin-bottom: 40px;
    max-width: 540px;
}

.rd-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.rd-feature {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rd-feature-icon {
    width: 24px;
    height: 24px;
    background: rgba(99, 231, 190, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    flex-shrink: 0;
}

.rd-feature-icon svg {
    width: 16px;
    height: 16px;
}

.rd-feature span {
    font-size: 16px;
    font-weight: 500;
    color: #e2e8f0;
}

.rd-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 40px;
    transition: var(--transition);
}

@media (hover: hover) {
    .glass-card:hover {
        background: rgba(255, 255, 255, 0.05);
        transform: translateY(-10px);
        border-color: rgba(99, 231, 190, 0.3);
    }
}

.rd-stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(99, 231, 190, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    margin-bottom: 20px;
}

.rd-stat-icon svg {
    width: 28px;
    height: 28px;
}

.rd-stat h4 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--color-white);
}

.rd-stat p {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 500;
}

/* --- Factory Section --- */
.factory {
    background-color: var(--color-bg-secondary);
    overflow-x: hidden;
}

.factory-gallery {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.fac-nav-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: -80px;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.5s ease;
    opacity: 0;
}

@media (max-width: 1460px) {
    .fac-nav-indicator {
        /* 通过精确的居中偏移计算，在此区间内动态维持 60px 边距 */
        right: calc(650px - 50vw);
    }
}

@media (max-width: 1280px) {
    .fac-nav-indicator {
        /* 在全宽状态下，固定容器内的 10px 等距于外侧边距 60px */
        right: 10px;
    }
}

.fac-nav-indicator.visible {
    opacity: 1;
}

.fac-nav-indicator svg {
    color: rgba(99, 231, 189, 0.4);
    width: 100px;
    height: 100px;
    animation: slideRightAnim 1.5s infinite ease-out;
}

@keyframes slideRightAnim {
    0% {
        transform: translateX(0);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    70% {
        opacity: 1;
    }

    100% {
        transform: translateX(15px);
        opacity: 0;
    }
}

.factory-scroll-wrapper {
    overflow-x: auto;
    padding-top: 20px;
    /* 防止 hover 卡片上浮被裁切 */
    padding-bottom: 30px;
    margin: -20px -20px 0 -20px;
    /* 负向抵消 padding 占用空间 */
    padding-left: 20px;
    scrollbar-width: none;
    scroll-behavior: smooth;
    /* 允许原生水平和垂直滑动，确保触摸设备滑动流畅 */
    touch-action: pan-x pan-y;
    /* 针对 iOS 的平滑滚动优化 */
    -webkit-overflow-scrolling: touch;
}

.factory-scroll-wrapper.dragging {
    scroll-behavior: auto;
    cursor: grabbing;
}

.factory-scroll-wrapper.dragging .fac-card {
    pointer-events: none;
}

.factory-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.factory-cards {
    display: flex;
    gap: 30px;
    width: max-content;
    padding-right: 60px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Elastic bounce transition */
}

.factory-cards.no-transition {
    transition: none;
}

.fac-card {
    width: 272px;
    height: 380px;
    /* 固定的无小数点的高度 */
    background: var(--color-white);
    border-radius: 24px;
    overflow: hidden;
    /* 修复 iOS/Safari 溢出圆角失效变成直角的问题 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    user-select: none;
    /* 防止在拖拽时选中文本 */
    -webkit-user-select: none;
    /* Safari 支持 */
}

@media (hover: hover) {
    .fac-card:hover {
        transform: translateY(-10px);
        box-shadow: var(--shadow-md);
    }
}

.fac-visual {
    height: 260px;
    background: #f8fafc;
    /* Very light neutral background instead of blue gradient */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fac-machine-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.05));
}

@media (hover: hover) {
    .fac-card:hover .fac-machine-img {
        transform: scale(1.1) translateY(-5px);
    }
}

.grid-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(99, 231, 190, 0.2) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.5;
}



/* removed liquid-orb */

.fac-info {
    padding: 24px;
}

.fac-info h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.fac-desc {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 0;
}

.factory-footer {
    margin-top: 48px;
}

.inline-flex {
    display: inline-flex;
}

.items-center {
    align-items: center;
}

.gap-2 {
    gap: 8px;
}

.mt-12 {
    margin-top: 48px;
}

/* --- Applications Section --- */
.applications {
    background-color: var(--color-bg);
    padding: 100px 0;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(2, 280px);
    gap: 20px;
}

.app-card {
    position: relative;
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
    cursor: default;
    color: #ffffff;
}

.app-card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
    pointer-events: none;
}

/* Span Definitions matching the precise pixel layout structure */
.app-card:nth-child(1) {
    grid-column: span 4;
    grid-row: span 2;
}

.app-card:nth-child(2) {
    grid-column: span 2;
    grid-row: span 1;
}

.app-card:nth-child(3) {
    grid-column: span 2;
    grid-row: span 1;
}

.app-card:nth-child(4) {
    grid-column: span 2;
    grid-row: span 1;
}

.app-card:nth-child(5) {
    grid-column: span 4;
    grid-row: span 1;
}

.app-card:nth-child(6) {
    grid-column: span 2;
    grid-row: span 1;
}

@media (hover: hover) {
    .app-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    }
}

.app-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.app-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (hover: hover) {
    .app-card:hover .app-bg img {
        transform: scale(1.05);
    }
}

.app-content {
    position: relative;
    z-index: 2;
    text-align: left;
}

.app-content h3 {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.app-content p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    margin: 0;
}

/* =========================================
   Hover & Large Touch Animation Effects (min-width: 769px)
   ========================================= */
@media (min-width: 769px) {

    /* --- product --- */
    .eco-card:hover,
    .eco-card.scroll-active {
        border-color: transparent;
    }

    .eco-card:hover .eco-bg img,
    .eco-card:hover::after,
    .eco-card.scroll-active .eco-bg img,
    .eco-card.scroll-active::after {
        opacity: 1;
    }

    .eco-card:hover .eco-info h3,
    .eco-card.scroll-active .eco-info h3 {
        transform: translateY(-40px) scale(0.75);
        color: #ffffff;
    }

    .eco-card:hover .eco-info p,
    .eco-card.scroll-active .eco-info p {
        opacity: 0;
        transform: translateY(20px);
    }

    .eco-card:hover .eco-visual img,
    .eco-card.scroll-active .eco-visual img {
        transform: scale(1.15) translateY(-5px);
    }

}

/* =========================================
   Responsive Breakpoints - 1024px Group
   (小于等于 1024px 需要改变的)
   ========================================= */

@media (max-width: 1024px) {

    /* --- product --- */
    .section-title {
        font-size: 28px;
        margin-bottom: 60px;
    }

    .ecosystem .container {
        padding: 0 50px;
    }

    .eco-3d-grid {
        grid-template-columns: 1fr;
        gap: 65px 60px;
    }

    .eco-info {
        width: 45%;
    }

    .eco-info h3 {
        font-size: 24px;
    }

    .eco-info p {
        font-size: 13px;
    }

    .eco-visual {
        top: 35%;
        right: 50px;
        transform: translateY(-50%);
        width: 240px;
        height: 240px;
    }

    .eco-visual img {
        filter: drop-shadow(0 25px 35px rgba(0, 0, 0, 0.18));
    }

    /* --- R&D Section --- */
    .rd-content {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .rd-text h2 {
        font-size: 38px;
    }

    /* --- Applications Section --- */
    .app-grid {
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: auto;
    }

    .app-card {
        min-height: 0;
        height: auto;
    }

    .app-card:nth-child(1) {
        grid-column: span 3;
        grid-row: auto;
        order: 2;
        aspect-ratio: 460 / 580;
    }

    .app-card:nth-child(2) {
        grid-column: span 3;
        order: 3;
        aspect-ratio: 220 / 280;
    }

    .app-card:nth-child(3) {
        grid-column: span 2;
        order: 4;
        aspect-ratio: 220 / 280;
    }

    .app-card:nth-child(4) {
        grid-column: span 2;
        order: 5;
        aspect-ratio: 220 / 280;
    }

    .app-card:nth-child(5) {
        grid-column: span 6;
        order: 1;
        aspect-ratio: 460 / 280;
    }

    .app-card:nth-child(6) {
        grid-column: span 2;
        order: 6;
        aspect-ratio: 220 / 280;
    }

}

/* =========================================
   Responsive Breakpoints - 768px Group
   (小于等于 768px 需要改变的)
   ========================================= */

@media (max-width: 768px) {

    /* --- hero --- */
    .hero-content {
        width: 100%;
        padding: 0 20px;
        margin-top: -300px;
        align-items: center !important;
        text-align: center;
        justify-content: center;
    }

    .hero-text {
        margin-left: 0;
        max-width: 350px;
    }

    .hero-text h1 {
        font-size: 32px;
    }

    .hero-text p {
        font-size: 18px;
        margin: 0 auto 30px;
    }

    /* --- product --- */
    .eco-3d-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .eco-card {
        padding: 20px 12px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        min-height: auto;
        overflow: hidden;
    }

    .eco-bg,
    .eco-card::after {
        z-index: 10;
        opacity: 1 !important;
        transform: translateY(var(--scene-y, 100%));
        transition: none;
    }

    .eco-bg img {
        opacity: 1 !important;
    }

    .eco-card.hover-animating .eco-bg,
    .eco-card.hover-animating::after {
        transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .eco-visual {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        width: 210px;
        height: 210px;
        order: 1;
        margin: 0 auto 12px;
        z-index: 5;
    }

    .eco-info {
        width: 100%;
        order: 2;
        z-index: 15;
    }

    .eco-info h3 {
        font-size: 20px;
        margin-bottom: 0;
        text-align: center;
        transform: translateY(var(--title-y, 0px)) scale(var(--h3-scale, 1));
        color: var(--title-color, #002B49);
        transition: none;
        transform-origin: center top;
    }

    .eco-card.hover-animating .eco-info h3 {
        transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .eco-info p {
        display: none;
    }

    /* --- R&D Section --- */
    .rd-text h2 {
        font-size: 32px;
    }

    .glass-card {
        padding: 30px;
    }

    /* --- Applications Section --- */
    .app-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 12px;
    }

    .app-card {
        padding: 20px;
    }

    .app-content h3 {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .app-content p {
        font-size: 12px;
    }

    .app-card:nth-child(5) {
        grid-column: span 4;
        order: 1;
    }

    .app-card:nth-child(6) {
        grid-column: span 2;
        order: 2;
    }

    .app-card:nth-child(1) {
        grid-column: span 3;
        order: 3;
    }

    .app-card:nth-child(2) {
        grid-column: span 3;
        order: 4;
    }

    .app-card:nth-child(3) {
        grid-column: span 3;
        order: 5;
    }

    .app-card:nth-child(4) {
        grid-column: span 3;
        order: 6;
    }

}