/* ==========================================================================
   CONNECT AI Assistant 模組
   ========================================================================== */

.connect-ai-module {
    background-color: var(--ai-bg, #ffffff);
    padding: 100px 0;
    overflow: hidden;
    /* 防止滾動動畫溢出 */
}

/* 標題與引言 */
.connect-ai-module .ai-header {
    text-align: center;
    max-width: 850px;
    margin: 0 auto 4rem auto;
}

.connect-ai-module .ai-intro {
    color: #4b5563;
    font-size: 1.15rem;
    line-height: 1.8;
    margin-top: 1rem;
}

/* 非對稱網格佈局 */
.connect-ai-module .ai-split-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 4rem;
    align-items: center;
    /* 💡 關鍵修復：利用 Grid 讓左右兩側永遠垂直置中 */
    margin-bottom: 5rem;
}

/* 左側黏性區塊 */
.connect-ai-module .ai-media-column {
    position: relative;
    height: 100%;
}

.connect-ai-module .ai-sticky-wrapper {
    position: sticky;
    top: 120px;
    /* 移除 transform，還原為基礎的頂部距離即可 */
    z-index: 2;
}

/* 科技感 GIF 容器 */
.connect-ai-module .ai-gif-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.connect-ai-module .ai-gif {
    width: 100%;
    height: auto;
    display: block;
}

/* 玻璃反光特效 (營造螢幕感) */
.connect-ai-module .glass-glare {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

/* 右側特色卡片列表 */
.connect-ai-module .ai-features-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.connect-ai-module .ai-feature-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    gap: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid #f3f4f6;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.connect-ai-module .ai-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 123, 138, 0.08);
    /* 科勝色微光陰影 */
    border-color: #e5e7eb;
}

.connect-ai-module .card-icon svg {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    padding: 6px;
    background: rgba(0, 137, 167, 0.1);
    border-radius: 8px;
}

.connect-ai-module .card-text h3 {
    font-size: 1.3rem;
    color: #111827;
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.connect-ai-module .card-text p {
    font-size: 1rem;
    line-height: 1.7;
    color: #4b5563;
    margin: 0;
}

/* 信任錨點 (企業級資安) */
.connect-ai-module .ai-trust-anchor {
    background: linear-gradient(135deg, #f0fbfb 0%, #ffffff 100%);
    /* 極淡的科勝藍綠漸層 */
    border-left: 6px solid #007b8a;
    border-radius: 12px;
    padding: 3rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.connect-ai-module .trust-icon svg {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.connect-ai-module .trust-content h3 {
    font-size: 1.5rem;
    color: #007b8a;
    /* 強調信任感 */
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 700;
}

.connect-ai-module .trust-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #374151;
    margin: 0;
}

.connect-ai-module .trust-content strong {
    color: #111827;
    font-weight: 700;
}

/* RWD 響應式 */
@media (max-width: 991px) {
    .connect-ai-module .ai-split-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        align-items: start;
        /* 💡 手機版轉為垂直排列時，必須改回靠上對齊，動線才順暢 */
    }

    .connect-ai-module .ai-sticky-wrapper {
        position: relative;
        top: 0;
    }

    .connect-ai-module .ai-trust-anchor {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
    }

    .connect-ai-module .trust-icon svg {
        width: 48px;
        height: 48px;
    }
}

/* 進入畫面的動畫初始狀態 */
.reveal-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   GIF 放大互動提示 (Hover State)
   ========================================================================== */
.connect-ai-module .zoomable-gif {
    cursor: zoom-in;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

/* 滑鼠懸停時產生 CONNECT 品牌色的科技微光陰影 */
.connect-ai-module .zoomable-gif:hover {
    transform: translateY(-4px) scale(1.01);
    /* 💡 關鍵修改：將原本的藍綠色替換為 CONNECT 黃色 (RGB: 255, 220, 25) */
    box-shadow: 0 15px 35px rgba(255, 220, 25, 0.35);
}

/* ==========================================================================
   AI 模組 - 多重 GIF 堆疊與智慧聚焦 (Smart Focus Stack)
   ========================================================================== */

/* 1. 堆疊容器排版 */
.connect-ai-module .ai-gif-stack {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    /* 電腦版保持寬敞的呼吸空間 */
    width: 100%;
}

/* 2. 確保 GIF 本身有平滑過渡設定 */
.connect-ai-module .ai-gif-container {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
}

/* 3. 💡 專家級 UX 微互動：智慧聚焦 (Focus Hover) */
/* 當滑鼠停留在整個 Stack 區域時，將「沒有被 Hover」的那個 GIF 變暗並微縮 */
.connect-ai-module .ai-gif-stack:hover .ai-gif-container:not(:hover) {
    opacity: 0.4;
    transform: scale(0.96);
    filter: grayscale(30%);
    /* 加上微微的灰階，進一步降低視覺干擾 */
}

/* 4. RWD 手機版與小筆電防呆微調 */
@media (max-width: 991px) {
    .connect-ai-module .ai-gif-stack {
        gap: 1.5rem;
        /* 手機版縮小間距，避免畫面被過度拉長 */
    }

    /* 手機版通常沒有游標 Hover，建議取消變暗特效，保持清晰 */
    .connect-ai-module .ai-gif-stack:hover .ai-gif-container:not(:hover) {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

/* 5. 確保小螢幕筆電的極限高度不被截斷 */
@media (max-height: 800px) and (min-width: 992px) {
    .connect-ai-module .ai-gif {
        max-height: 32vh;
        /* 如果螢幕高度太矮，強制等比例縮小，保護 Sticky 行為 */
        object-fit: contain;
    }
}

/* ==========================================================================
   AI 模組 - GIF 雙欄展示畫廊 (Gallery Layout)
   ========================================================================== */
.connect-ai-module .ai-gif-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 電腦版完美對稱雙欄 */
    gap: 2.5rem;
    max-width: 1000px;
    /* 限制最大寬度，避免在大螢幕上 GIF 被拉得過度巨大 */
    margin: 0 auto;
}

/* 確保 GIF 容器擁有高級科技陰影與圓角 (沿用原有的 ai-gif-container 特效) */
.connect-ai-module .ai-gif-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    background: #ffffff;
    border: 1px solid #e5e7eb;
    /* 防禦 CLS：設定基礎比例 */
    aspect-ratio: 16/10;
    display: flex;
    align-items: center;
}

.connect-ai-module .ai-gif {
    width: 100%;
    height: auto;
    display: block;
}

/* RWD 手機版防呆 */
@media (max-width: 768px) {
    .connect-ai-module .ai-gif-gallery {
        grid-template-columns: 1fr;
        /* 手機版自動轉為上下堆疊 */
        gap: 1.5rem;
    }
}