﻿/* =========================================
   1. Design System & Variables (設計系統)
   ========================================= */
:root {
    /* 色票系統 */
    --bg-color: #050505;
    --text-main: #ffffff;
    --text-muted: #e0e0e0; /* 提高亮度，避免看起來髒髒的 */
    
    /* Apple/Tech Accent Colors */
    --accent-blue: #0071e3; 
    --accent-blue-glow: #409cff; 
    --accent-purple: #bf5af2;
    
    /* Glass Effect (全域) */
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: 20px;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
    
    /* Layout */
    --container-width: 1200px;
    --header-height: 70px;
    
    /* Animation */
    --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 基礎重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased; /* 讓字體在 Mac 上更細緻 */
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

a, button {
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    color: inherit;
}

/* =========================================
   2. Background FX (極光背景 - 高動態呼吸版)
   ========================================= */
.ambient-light-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden;
    z-index: 1; 
    pointer-events: none;
}

.light-blob {
    position: absolute;
    border-radius: 50%;
    /* 稍微降低模糊，讓光中心更實、更亮 */
    filter: blur(60px); 
    opacity: 0.8; /* 基礎亮度提高 */
    mix-blend-mode: screen; /* 關鍵：疊加變亮模式 */
    will-change: transform, border-radius, filter, opacity;
}

/* 
   調整策略：
   1. 尺寸加大：增加重疊面積，製造更多高亮白光區域。
   2. 顏色更飽和：起始色改用更高飽和度的色票。
*/

.blob-1 {
    top: -10%; left: -10%; 
    width: 800px; height: 800px;
    background: radial-gradient(circle, #0055ff, transparent 65%); /* 深藍核心 */
    animation: intenseBreath 18s ease-in-out infinite;
}

.blob-2 {
    bottom: -15%; right: -15%; 
    width: 700px; height: 700px;
    background: radial-gradient(circle, #b000ff, transparent 65%); /* 亮紫核心 */
    animation: intenseBreath 22s ease-in-out infinite reverse; /* 反向 */
}

.blob-3 {
    top: 35%; left: 35%; 
    width: 600px; height: 600px;
    background: radial-gradient(circle, #00d5ff, transparent 60%); /* 亮青核心 */
    opacity: 0.6;
    animation: intenseBreath 25s ease-in-out infinite -5s;
}

/* 
   核心動畫：劇烈呼吸 (Intense Breath)
   特點：位移大、色相旋轉大、忽明忽暗明顯
*/
@keyframes intenseBreath {
    0% {
        transform: translate(0, 0) scale(1);
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        filter: blur(60px) hue-rotate(0deg);
        opacity: 0.7;
    }
    25% {
        /* 大幅位移 + 變色 (藍 -> 紫) + 變亮 */
        transform: translate(150px, -100px) scale(1.2);
        border-radius: 40% 60% 70% 30% / 50% 60% 30% 60%;
        filter: blur(60px) hue-rotate(45deg); 
        opacity: 0.95; /* 接近全亮 */
    }
    50% {
        /* 反向位移 + 變色 (紫 -> 粉紅) + 變暗 */
        transform: translate(-100px, 150px) scale(0.9);
        border-radius: 70% 30% 50% 50% / 30% 70% 60% 40%;
        filter: blur(80px) hue-rotate(90deg); /* 顏色轉 90度 */
        opacity: 0.5; /* 呼吸變暗 */
    }
    75% {
        /* 側向位移 + 變色回歸 + 再次變亮 */
        transform: translate(100px, 100px) scale(1.1);
        border-radius: 50% 50% 20% 80% / 20% 80% 50% 50%;
        filter: blur(60px) hue-rotate(45deg);
        opacity: 0.9;
    }
    100% {
        transform: translate(0, 0) scale(1);
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        filter: blur(60px) hue-rotate(0deg);
        opacity: 0.7;
    }
}
/* =========================================
   3. Utility Classes
   ========================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
}

.section-padding {
    padding: 100px 0;
    position: relative;
    z-index: 2;
}

.text-gradient {
    /* 預設的漸層文字類別，如果需要可使用 */
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =========================================
   4. Header & Navigation
   ========================================= */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%; height: var(--header-height);
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-container {
    display: flex; justify-content: space-between; align-items: center; height: 100%;
}

.logo {
    font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; gap: 12px;
}
.logo img { height: 40px; width: auto; }

.nav-links { display: flex; gap: 30px; }
.nav-link {
    font-size: 0.95rem; font-weight: 500; color: #a1a1aa; transition: color 0.3s;
}
.nav-link:hover { color: var(--text-main); }

/* =========================================
   5. Hero Section (修正：對齊與流光)
   ========================================= */
.hero {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    padding-top: var(--header-height);
    z-index: 2;
}

.hero-bg-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('https://qiduar.com/assets/img/hero-bg.jpg');
    background-size: cover; background-position: center;
    z-index: -1;
    filter: brightness(0.65) contrast(1.3);
}

.hero-content {
    width: 100%; display: flex; justify-content: center;
    margin: 48px 0;
}

/* --- Hero 卡片核心修正 --- */
.hero-glass-card {
    background: rgba(10, 10, 10, 0.4); /* 背景加深，增加文字可讀性 */
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    
    /* 關鍵：讓 border 也是透明的，交給 ::after 處理 */
    border: 1px solid transparent; 
    border-radius: 32px; /* 父層圓角 */
    
    padding: 60px 40px;
    text-align: center;
    max-width: 800px;
    width: 100%;
    position: relative;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
    
    /* 確保偽元素不會跑出去 */
    /* overflow: hidden; -> 暫不使用 hidden，以免切到某些外光暈效果，改用 inset 對齊 */
}

/* 流動邊光 (Shimmer Border) 修正版 */
/* =========================================
   修正：流動邊光 (Shimmer Border) - 優化版
   ========================================= */
.hero-glass-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit; /* 完美繼承父層圓角 */
    padding: 1.5px; /* 邊框細度 */
    
    /* 
       漸層優化策略：
       1. 頭尾都是 transparent：確保動畫開始與結束時都是「全黑」的，解決斷點問題。
       2. 光線佔比縮小：光線只集中在 45%~55% 的區域，其他都是黑的。
       3. 降低亮度：最大透明度降為 0.3，更低調奢華。
    */
    background: linear-gradient(
        115deg, 
        transparent 0%, 
        transparent 40%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 60%, 
        transparent 100%
    );
    
    /* 關鍵：背景放大 3 倍
       這代表光線只佔整體的 1/3 寬度，
       剩下的 2/3 都是透明的，這樣動畫在跑的時候就會有「休息時間」。
    */
    background-size: 300% 300%;
    
    /* Mask 設定 (只顯示邊框) */
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    
    /* 
       動畫優化：
       6s: 放慢速度，讓光影慢慢滑過。
       ease-in-out: 讓光線進入與離開時有加減速感，更自然。
    */
    animation: borderShimmer 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes borderShimmer {
    /* 
       0% 時，背景位置在最右下角 (對應 gradient 的 100% 處，是透明的)
       100% 時，背景位置移到最左上角 (對應 gradient 的 0% 處，也是透明的)
       這樣就形成了：透明(黑) -> 光線滑過 -> 透明(黑) -> 無縫循環
    */
    0% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

/* 內容樣式 */
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: 50px;
    background: rgba(0, 113, 227, 0.2);
    border: 1px solid rgba(0, 113, 227, 0.4);
    color: #4daaff; font-size: 0.9rem; font-weight: 600;
    margin-bottom: 24px;
}

.hero-title {
    font-size: 3.5rem; font-weight: 800; line-height: 1.25;
    margin-bottom: 24px; letter-spacing: -0.02em;
    color: #ffffff; /* 純白，解決髒髒感 */
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* 重點文字流光 */
.highlight-text {
    background: linear-gradient(90deg, #2997ff 0%, #bf5af2 50%, #2997ff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShine 5s linear infinite;
}
@keyframes textShine { to { background-position: 200% center; } }

.hero-desc {
    font-size: 1.2rem; color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px; line-height: 1.6;
}

.hero-actions { display: flex; gap: 16px; justify-content: center; }

/* 按鈕 */
.btn {
    padding: 14px 28px; border-radius: 12px;
    font-weight: 600; font-size: 1rem; cursor: pointer;
    transition: all 0.3s var(--ease-out);
    display: inline-flex; align-items: center; gap: 8px; border: none;
}
.btn-primary {
    background: var(--accent-blue); color: white;
    box-shadow: 0 0 25px rgba(0, 113, 227, 0.5);
}
.btn-primary:hover {
    transform: translateY(-2px); background: #0077ed;
    box-shadow: 0 0 40px rgba(0, 113, 227, 0.7);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.1); color: white;
    border: 1px solid rgba(255, 255, 255, 0.2); backdrop-filter: blur(10px);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-2px); }

/* =========================================
   6. Trust Bar
   ========================================= */
.trust-bar {
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.4); backdrop-filter: blur(10px);
    padding: 24px 0; position: relative; z-index: 2;
}
.marquee {
    display: flex; gap: 40px; white-space: nowrap;
    justify-content: center; flex-wrap: wrap;
}
.trust-item {
    display: flex; align-items: center; gap: 10px; color: #ccc; font-weight: 500;
}
.trust-item i { color: var(--accent-blue-glow); }

/* =========================================
   7. Services Grid (修正：對齊與高度)
   ========================================= */
.section-title { text-align: center; margin-bottom: 60px; }
.section-title h2 { font-size: 2.5rem; margin-bottom: 16px; font-weight: 700; }
.section-title p { color: var(--text-muted); max-width: 600px; margin: 0 auto; }

.services-grid {
    display: grid;
    /* 修正：確保最小寬度適中 */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    /* 修正：讓所有 Grid Item 高度拉伸至一致 */
    align-items: stretch; 
}

.service-card {
    padding: 32px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s var(--ease-out), border-color 0.3s;
    
    /* 修正：強制高度 100% 並使用 Flex 讓內容垂直分佈 */
    height: 100%; 
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    
    background: rgba(255, 255, 255, 0.03); /* 預設深一點 */
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: rgba(41, 151, 255, 0.5);
    background: rgba(255, 255, 255, 0.07);
}

.service-icon {
    width: 56px; height: 56px; border-radius: 16px;
    background: rgba(0, 113, 227, 0.15); color: var(--accent-blue-glow);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; margin-bottom: 24px;
    border: 1px solid rgba(0, 113, 227, 0.2);
    /* 防止 icon 被壓縮 */
    flex-shrink: 0; 
}

.service-card h3 { font-size: 1.25rem; margin-bottom: 12px; }
.service-card p {
    color: var(--text-muted); font-size: 0.95rem;
    flex-grow: 1; /* 讓文字區塊佔滿剩餘空間 */
}

/* =========================================
   8. Process Steps
   ========================================= */
.process-steps {
    display: flex; justify-content: space-between; gap: 20px;
    flex-wrap: wrap; position: relative;
}
.step-item {
    flex: 1; min-width: 250px; text-align: center;
    position: relative; z-index: 1; padding: 20px;
}
.step-number {
    width: 64px; height: 64px; background: rgba(0,0,0,0.4);
    border: 2px solid var(--accent-blue); color: var(--accent-blue-glow);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.5rem; margin: 0 auto 20px auto;
    box-shadow: 0 0 20px rgba(0, 113, 227, 0.3);
}

/* =========================================
   9. FAQ
   ========================================= */
/* =========================================
   FAQ (常見問答) - Grid 動態高度修正版
   ========================================= */
.faq-grid {
    display: grid;
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    cursor: pointer;
    transition: background 0.3s;
}

.faq-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.faq-question {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.1rem;
    /* 防止點擊時文字被選取 */
    user-select: none; 
}

.faq-icon {
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); /* 更滑順的旋轉 */
    color: var(--text-muted);
    font-size: 1.2rem;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    color: var(--accent-blue-glow);
}

/* --- 核心修改開始 --- */

/* 外層容器：負責高度動畫 (0 -> 1) */
.faq-answer {
    display: grid;
    grid-template-rows: 0fr; /* 預設高度為 0 */
    transition: grid-template-rows 0.4s ease-out; /* 動畫時間 */
}

/* 當被啟動時，高度變為 1fr (自動撐開) */
.faq-item.active .faq-answer {
    grid-template-rows: 1fr;
}

/* 內層容器：負責放置內容與 Padding */
.faq-content {
    overflow: hidden; /* 隱藏超出部分，這是動畫必須的 */
    color: var(--text-muted);
    line-height: 1.8; /* 增加行距，閱讀更舒適 */
    font-size: 0.95rem;
    white-space: pre-line;
    /* 這裡設定 Padding，但預設被 grid 0fr 隱藏 */
    padding: 0 24px; 
    opacity: 0; /* 預設隱藏文字 */
    transform: translateY(-10px); /* 文字稍微往上移 */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 展開時的文字特效 */
.faq-item.active .faq-content {
    /* 增加底部 Padding，解決貼底問題 */
    padding-bottom: 24px; 
    
    /* 文字淡入效果 */
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s; /* 等盒子稍微打開後再顯示文字 */
}

/* =========================================
   10. Footer & Floating Bar
   ========================================= */
footer {
    position: relative; z-index: 2; border-top: 1px solid var(--glass-border);
    background: #000; padding: 60px 0 100px 0;
}
.footer-content {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px;
}
.footer-logo h2 { font-size: 1.5rem; margin-bottom: 16px; color: #fff; }
.footer-logo p { color: #888; font-size: 0.9rem; max-width: 300px; }
.footer-info h3, .footer-links h3 { font-size: 1.1rem; margin-bottom: 20px; color: #fff; }
.footer-info p, .footer-links p {
    color: #aaa; margin-bottom: 12px; display: flex; align-items: center; gap: 10px;
}
.footer-links a:hover { color: var(--accent-blue-glow); text-decoration: underline; }

.mobile-fab-bar {
    position: fixed; bottom: 20px; left: 20px; right: 20px; height: 70px;
    background: rgba(30, 30, 30, 0.4);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.15); border-radius: 20px;
    display: flex; align-items: center; padding: 0 10px;
    z-index: 999; box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    display: none;
}
.fab-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 0.8rem; color: #ccc; gap: 4px;
}
.fab-btn.primary {
    background: var(--accent-blue); color: white; height: 50px;
    border-radius: 15px; flex: 1.5; flex-direction: row; font-size: 1rem; font-weight: 600; gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 113, 227, 0.4);
}

/* RWD */
@media (max-width: 768px) {
    .hero-glass-card {
        padding: 40px 24px; margin: 0 16px; border-radius: 24px;
        backdrop-filter: blur(7px);
    }
    .hero-title { font-size: 2.2rem; }
    .mobile-fab-bar { display: flex; }
    .nav-links, .navbar .btn { display: none; }
    .hero-actions { flex-direction: column; width: 100%; }
    .btn { width: 100%; justify-content: center; }
    .blob-1 { width: 300px; height: 300px; opacity: 0.5; }
    .blob-2 { width: 300px; height: 300px; opacity: 0.5; }
}
/* =========================================
   13. Small Device Fixes (針對 320px~375px 小螢幕優化)
   ========================================= */
@media (max-width: 380px) {
    
    /* 1. 全域容器調整：爭取每一像素的空間 */
    .container {
        padding: 0 16px; /* 減少左右留白 */
    }

    /* 2. Hero 區域：縮小字體與內距 */
    .hero-glass-card {
        padding: 40px 20px; /* 左右內距從 40px 減半為 20px */
        margin: 0; /* 移除額外邊距，讓卡片盡量寬 */
        width: 100%;
        border-radius: 20px; /* 圓角稍微縮小以適應窄螢幕 */
    }

    .hero-title {
        font-size: 2rem; /* 字體從 2.2rem 再縮小 */
        line-height: 1.3;
        margin-bottom: 20px;
    }

    .hero-desc {
        font-size: 0.95rem; /* 描述文字縮小 */
        margin-bottom: 30px;
    }

    .hero-badge {
        font-size: 0.8rem;
        padding: 6px 12px;
        white-space: nowrap; /* 強制不換行 */
    }

    /* 按鈕改為垂直排列，確保手指好點擊 */
    .hero-actions {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .btn {
        width: 100%; /* 按鈕佔滿寬度 */
        justify-content: center;
        padding: 12px 20px; /* 稍微變薄 */
    }

    /* 3. Service Grid 關鍵修復：解決跑版核心 */
    .services-grid {
        /* 原本 minmax(300px) 在 320px 螢幕會爆版 */
        /* 改為 100% 讓它自動適應螢幕寬度 */
        grid-template-columns: 1fr; 
        gap: 16px;
    }

    .service-card {
        padding: 24px; /* 減少卡片內部 padding */
    }
    
    .service-icon {
        margin-bottom: 16px; /* 縮小間距 */
    }

    /* 4. 維修流程調整 */
    .step-item {
        min-width: 100%; /* 強制一行一個步驟 */
        padding: 15px;
    }

    /* 5. 底部懸浮按鈕 (FAB) 優化 */
    .mobile-fab-bar {
        padding: 0 8px; /* 減少邊距 */
        gap: 8px; /* 減少按鈕間距 */
        height: 64px; /* 稍微變矮 */
    }

    .fab-btn {
        font-size: 0.75rem; /* 字體縮小 */
    }

    .fab-btn i {
        font-size: 1.1rem;
    }
    
    /* 調整主要按鈕的比例，避免擠壓到其他按鈕 */
    .fab-btn.primary {
        flex: 1.3; 
        font-size: 0.9rem;
    }
}