/* ============================================================
   WL-Bot 首頁樣式 (Mobile First - 預設手機版)
   首頁特定的 3D 展示架樣式
   ============================================================ */

/* === 1. 3D 舞台 (Hero Stage) === */
.hero-stage {
    height: auto; /* 改為自動高度，讓內容撐開容器 */
    min-height: 80vh; /* 設定最小高度，確保有足夠視覺空間 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    perspective: 800px;
    position: relative;
    padding: 20px 0 60px; /* 減少頂部空間，讓大卡片往上移 */
    overflow: visible;
    background: radial-gradient(circle at center 40%, rgba(255, 215, 0, 0.02) 0%, transparent 60%); /* 微妙的金色氛圍光 */
}

/* === 2. 卡片展示架與佈局系統 (Rack & Layouts) === */
.card-rack {
    width: 100%;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: visible;
    justify-content: center;
    align-items: center;
    gap: 0px;
    padding: 20px 20px 40px; /* 上 左右 下 */
    min-height: 700px; /* 降低最小高度，避免過多留白 */
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 0px;
    transform-style: preserve-3d;
    position: relative;
    transition: all 0.5s ease;
}

.card-rack::-webkit-scrollbar {
    display: none;
}

/* === 3. 單張卡片容器 (Slab) === */
.slab-container {
    flex: 0 0 auto;
    width: 85vw; /* 手機版：極大化寬度 (85%) */
    max-width: 450px; /* 放寬最大限制 */
    margin: 0 15px;
    scroll-snap-align: center;
    aspect-ratio: 320 / 540;
    position: relative;
    transform: translateZ(0) rotateY(0);
    filter: brightness(0.85); /* 提高預設亮度，讓圖片更清晰 */
    transition: transform 0.2s ease-out, filter 0.3s;
    /* 手機版/通用倒影 - 縮短長度避免重疊 */
    -webkit-box-reflect: below 2px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.6, transparent), to(rgba(0,0,0,0.5))) !important;
}

.slab-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 12px;
    background: #1a1a1a;
}

.glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 60%);
    opacity: 0;
    mix-blend-mode: overlay;
    pointer-events: none;
    transition: opacity 0.1s;
    border-radius: 12px;
}

/* === 4. 圖庫控制元件 (Gallery Controls) === */
.gallery-controls {
    display: none;
    position: absolute;
    top: auto;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 300px;
    padding: 0 20px;
    justify-content: space-between;
    align-items: center;
    z-index: 103;
    pointer-events: none;
}

.gallery-arrow {
    pointer-events: auto;
    width: 40px;
    height: 40px;
    font-size: 16px;
    margin: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.gallery-arrow:active {
    transform: scale(0.95);
}

.gallery-dots {
    margin-top: 20px; /* 手機版：確保位於卡片下方 */
    margin-bottom: 20px;
    position: relative; /* 改為相對定位，避免重疊 */
    bottom: auto;
    left: auto;
    transform: none;
    width: 100%; /* 居中 */
    gap: 8px;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.gallery-dot:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.3);
}

.gallery-dot.active {
    background: var(--accent-gold);
    width: 10px;
    height: 10px;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.8);
}

/* === 5. UI 層 (文字、搜尋框、按鈕) === */
.ui-layer {
    text-align: center;
    z-index: 20;
    position: relative;
    transform: translateY(-40px);
}

/* === 6. 功能特色區塊 (Features) === */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
    margin-top: 20px;
    position: relative;
    z-index: 10;
    max-width: 100%;
}

/* === 7. CTA 區塊 === */
.cta-section {
    background: transparent;
    border-top: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 60px 0;
    text-align: center;
}

.cta-section h2 {
    color: var(--text-main);
    margin-bottom: 20px;
}

.cta-section .lead {
    color: var(--text-main);
    opacity: 0.8;
}



/* === 9. 超小螢幕適配 === */
@media (max-width: 480px) {
    .slab-container {
        width: 180px;
    }
    
    .card-rack {
        padding: 0 calc(50% - 105px);
    }
    
    .slab-container.grid-mode {
        width: 280px;
    }
}
