/* ============================================
   人工智能實驗室 AI Lab — 專用樣式
   七款產品各有專屬漸變色班與裝飾圖案
   ============================================ */

/* ---------- Hero ---------- */
.ai-lab-hero {
    position: relative;
    min-height: 480px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a40 0%, #270082 45%, #7a0bc0 100%);
    color: #fff;
}

/* 漂浮裝飾圓點與光暈 */
.ai-lab-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 25%, rgba(250, 84, 179, 0.35) 0, transparent 28%),
        radial-gradient(circle at 85% 20%, rgba(88, 199, 250, 0.30) 0, transparent 26%),
        radial-gradient(circle at 75% 85%, rgba(255, 200, 87, 0.25) 0, transparent 24%),
        radial-gradient(circle at 25% 80%, rgba(103, 232, 249, 0.20) 0, transparent 22%);
    pointer-events: none;
}

.ai-lab-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1.5px, transparent 1.5px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 75%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 75%);
    pointer-events: none;
}

.ai-lab-hero .container {
    position: relative;
    z-index: 1;
}

.ai-lab-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(6px);
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

.ai-lab-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.15;
}

.ai-lab-hero h1 .gradient-text {
    background: linear-gradient(90deg, #ffd166, #fa54b3, #58c7fa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-lab-hero .lead {
    color: rgba(255, 255, 255, 0.85);
    max-width: 720px;
}

.ai-lab-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 2rem;
}

.ai-lab-hero-stats .stat .num {
    font-size: 2rem;
    font-weight: 800;
    color: #ffd166;
}

.ai-lab-hero-stats .stat .label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
}

/* 漂浮幾何圖形動畫 */
.ai-float-shape {
    position: absolute;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    opacity: 0.5;
    animation: aiFloat 9s ease-in-out infinite;
    pointer-events: none;
}

.ai-float-shape.s1 { width: 110px; height: 110px; top: 12%; right: 8%;  background: linear-gradient(135deg, #fa54b3, #7a0bc0); animation-delay: 0s; }
.ai-float-shape.s2 { width: 70px;  height: 70px;  top: 60%; right: 18%; background: linear-gradient(135deg, #58c7fa, #270082); animation-delay: 2s; }
.ai-float-shape.s3 { width: 50px;  height: 50px;  top: 30%; right: 26%; background: linear-gradient(135deg, #ffd166, #fa8c54); animation-delay: 4s; }

@keyframes aiFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-22px) rotate(12deg); }
}

@media (prefers-reduced-motion: reduce) {
    .ai-float-shape { animation: none; }
}

/* ---------- 身份篩選 chips ---------- */
.ai-filter-bar {
    position: sticky;
    top: 76px; /* 避開 fixed-top navbar */
    z-index: 20;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #eef0f6;
    padding: 0.9rem 0;
}

.ai-filter-chip {
    border: 2px solid #e4e7f2;
    background: #fff;
    color: #444;
    border-radius: 999px;
    padding: 0.45rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.25s ease;
}

.ai-filter-chip:hover {
    border-color: #7a0bc0;
    color: #7a0bc0;
    transform: translateY(-1px);
}

.ai-filter-chip.active {
    background: linear-gradient(135deg, #270082, #7a0bc0);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(122, 11, 192, 0.35);
}

/* ---------- 產品卡片 ---------- */
.ai-product-card {
    position: relative;
    border: none;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 28px rgba(30, 27, 75, 0.10);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ai-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 44px rgba(30, 27, 75, 0.18);
}

/* 卡片頂部色帶（含圖案） */
.ai-card-banner {
    position: relative;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ai-card-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1.5px, transparent 1.5px);
    background-size: 22px 22px;
}

.ai-card-banner::after {
    content: '';
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    right: -90px;
    top: -120px;
}

.ai-card-banner .product-icon {
    position: relative;
    z-index: 1;
    width: 84px;
    height: 84px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    transition: transform 0.3s ease;
}

.ai-product-card:hover .product-icon {
    transform: scale(1.1) rotate(-4deg);
}

/* 七款產品漸變色班 */
.palette-violet { background: linear-gradient(135deg, #6d28d9 0%, #a855f7 60%, #d8b4fe 100%); }
.palette-sky    { background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 60%, #7dd3fc 100%); }
.palette-indigo { background: linear-gradient(135deg, #3730a3 0%, #6366f1 60%, #a5b4fc 100%); }
.palette-rose   { background: linear-gradient(135deg, #be185d 0%, #f472b6 60%, #fbcfe8 100%); }
.palette-teal   { background: linear-gradient(135deg, #0f766e 0%, #14b8a6 60%, #5eead4 100%); }
.palette-amber  { background: linear-gradient(135deg, #b45309 0%, #f59e0b 55%, #fcd34d 100%); }
.palette-grape  { background: linear-gradient(135deg, #581c87 0%, #9333ea 60%, #c084fc 100%); }
.palette-emerald { background: linear-gradient(135deg, #047857 0%, #10b981 60%, #6ee7b7 100%); }

/* 卡片內容 */
.ai-card-body {
    padding: 1.6rem 1.6rem 1.4rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ai-card-body .product-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e1b4b;
    margin-bottom: 0.15rem;
}

.ai-card-body .product-name-en {
    font-size: 0.82rem;
    color: #8a8fa8;
    margin-bottom: 0.7rem;
    min-height: 2.1em;
}

.ai-card-body .product-tagline {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 8px;
    padding: 0.25rem 0.7rem;
    margin-bottom: 0.8rem;
    background: #f4f2ff;
    color: #5b21b6;
}

.ai-card-body .product-desc {
    font-size: 0.92rem;
    color: #555;
    line-height: 1.75;
    flex: 1;
}

.ai-feature-list {
    list-style: none;
    padding: 0;
    margin: 0.9rem 0 1.1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 0.8rem;
}

.ai-feature-list li {
    font-size: 0.83rem;
    color: #444;
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
}

.ai-feature-list li i {
    color: #22c55e;
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.ai-audience-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
}

.ai-audience-tags .tag {
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #e0e7ff;
}

.ai-launch-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    transition: all 0.25s ease;
}

.ai-launch-btn:hover {
    color: #fff;
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 8px 20px rgba(30, 27, 75, 0.25);
}

.ai-launch-btn i {
    transition: transform 0.25s ease;
}

.ai-launch-btn:hover i {
    transform: translateX(4px);
}

/* 卡片進場動畫 */
.ai-card-wrapper {
    animation: aiCardIn 0.5s ease-out both;
}

.ai-card-wrapper.hidden-by-filter {
    display: none;
}

@keyframes aiCardIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .ai-card-wrapper { animation: none; }
}

/* 篩選後無結果提示 */
.ai-empty-state {
    display: none;
    text-align: center;
    padding: 4rem 1rem;
    color: #8a8fa8;
}

.ai-empty-state.show {
    display: block;
}

/* ---------- 底部 CTA ---------- */
.ai-lab-cta {
    background: linear-gradient(135deg, #1a1a40 0%, #270082 55%, #7a0bc0 100%);
    border-radius: 26px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.ai-lab-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1.5px, transparent 1.5px);
    background-size: 28px 28px;
}

.ai-lab-cta .container,
.ai-lab-cta .row {
    position: relative;
    z-index: 1;
}

/* 手機適配 */
@media (max-width: 768px) {
    .ai-filter-bar { top: 66px; }
    .ai-feature-list { grid-template-columns: 1fr; }
    .ai-lab-hero { min-height: 420px; }
}
