@charset "utf-8";

/* =========================================
   2. MainService 主要服務 (卡片式)
   ========================================= */
.MainService { background-color: var(--white); }
.main-service-grid { grid-template-columns: repeat(4, 1fr); gap: 2rem; margin-top: 2rem; }
.main-service-card { 
    background-color: var(--white); padding: 2.5rem 1.5rem; border-radius: var(--radius-md); 
    text-align: center; transition: all 0.3s ease; border: 1px solid #f0f0f0; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.03); height: 100%; display: flex; flex-direction: column; 
    align-items: center; text-decoration: none; color: inherit; 
}
.main-service-card:hover { 
    transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); border-color: transparent; 
}
.main-service-icon { 
    width: 10rem; height: 10rem; background-color: rgba(9, 132, 227, 0.1); 
    color: var(--primary-color); border-radius: 50%; display: flex; align-items: center; 
    justify-content: center; font-size: 4.5rem; margin-bottom: 1.5rem; transition: 0.3s; 
}
.main-service-card:hover .main-service-icon { 
    background-color: var(--primary-color); color: #fff; transform: rotateY(180deg); 
}
.main-service-title { font-size: var(--font-h3); font-weight: 700; color: var(--text-color); margin-bottom: 1rem; }
.main-service-desc { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; }

/* =========================================
   3. About Us 區塊 (深色底 + 視差)
   ========================================= */
.about { 
    background-size: cover; background-position: center; background-attachment: fixed; color: var(--text-light); 
}
.about::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.85); z-index: 1; }
.about .container { position: relative; z-index: 2; }
/* 指定 About 內的標題顏色反白 */
.about .section-title { color: var(--text-light); }
.about .section-desc { color: var(--text-light-muted); }

.about-wrapper { display: flex; align-items: center; gap: var(--gap-xl); }
.about-image { flex: 1; border-radius: 0.5rem; overflow: hidden; box-shadow: 0 1.25rem 2.5rem rgba(0,0,0,0.5); }
.about-image img { display: block; width: 100%; height: auto; transition: transform 0.5s ease; }
.about-image:hover img { transform: scale(1.05); }
.about-text { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }

/* =========================================
   4. Case 網站作品區塊 (Bento Grid)
   ========================================= */
.Case { background-color: var(--bg-color); } 
.works-bento { 
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); 
    grid-template-rows: auto auto; gap: 1.5rem; margin-top: 2rem; width: 100%; 
}
.work-card { 
    position: relative; width: 100%; display: block; background-color: #000; 
    border-radius: var(--radius-lg); overflow: hidden; min-width: 0; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.1); height: 100%; 
}
.work-card:focus-visible { outline: none; border-radius: var(--radius-lg); }
.work-card:focus-visible::after { 
    content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; 
    box-shadow: inset 0 0 0 3px var(--focus-ring-color); border-radius: var(--radius-lg); 
    z-index: 20; pointer-events: none; 
}
.work-thumb { width: 100%; height: 100%; position: relative; z-index: 1; }
.work-thumb img { 
    width: 100%; height: 100%; object-fit: cover; display: block; 
    transform: scale(1); transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); 
}
.work-card:hover .work-thumb img { transform: scale(1.1); }
.work-tag { 
    position: absolute; top: 1.25rem; left: 1.25rem; background-color: var(--primary-color); 
    color: #fff; border-radius: var(--radius-tag); padding: 0.25rem 0.75rem; 
    font-size: 0.8125rem; font-weight: 600; z-index: 10; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.25); pointer-events: none; letter-spacing: 0.05em; 
}
.work-overlay { 
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 3rem 2rem 2rem 2rem; z-index: 5; 
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 50%, transparent 100%); 
    transform: translateY(101%); transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); 
    display: flex; flex-direction: column; justify-content: flex-end; 
}
.work-card:hover .work-overlay { transform: translateY(0); }
.work-title { font-size: var(--font-h3); font-weight: 700; margin-bottom: 0.5rem; color: #fff; line-height: 1.3; }
.work-desc { font-size: 0.95rem; color: rgba(255, 255, 255, 0.85); line-height: 1.5; margin: 0; }

/* Grid Span Rules */
.item-main { grid-column: 1 / 3; grid-row: 1 / 2; aspect-ratio: 16 / 9; }
.item-sub1 { grid-column: 1 / 2; grid-row: 2 / 3; aspect-ratio: 1 / 1; }
.item-sub2 { grid-column: 2 / 3; grid-row: 2 / 3; aspect-ratio: 1 / 1; }
.item-tall { grid-column: 3 / 5; grid-row: 1 / 3; height: auto; }

/* =========================================
   5. Mid Page Banner (插播廣告)
   ========================================= */
.mid-page-banner { 
    background-size: cover; background-position: center 40%; background-attachment: fixed; 
    text-align: center; padding: 7rem 0 !important; 
} 
.mid-page-banner::before { 
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(62, 58, 54, 0.6); 
}
.mid-banner-text { position: relative; z-index: 2; color: var(--white); }
.mid-banner-text h2 { font-size: 2.5rem; margin-bottom: 1rem; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
.mid-banner-text p { font-size: 1.25rem; opacity: 0.9; }

/* =========================================
   6. Service 核心服務 (Tabs 切換)
   ========================================= */
.Service { background-color: var(--white); color: var(--text-color); }
.service-tabs { 
    display: flex; justify-content: center; gap: 2rem; margin-bottom: 3rem; 
    border-bottom: 1px solid #eee; position: relative; 
}
.tab-btn { 
    background: none; border: none; font-size: 1.125rem; font-weight: 500; 
    color: var(--text-muted); padding: 1rem 0.5rem; cursor: pointer; 
    position: relative; transition: all 0.3s; white-space: nowrap; 
}
.tab-btn:hover, .tab-btn.active { color: var(--primary-color); }
.tab-btn.active { font-weight: 700; }
.tab-btn::after { 
    content: ""; position: absolute; bottom: -1px; left: 0; width: 0; 
    height: 3px; background-color: var(--primary-color); transition: width 0.3s ease; 
}
.tab-btn.active::after { width: 100%; }
.tab-btn:focus-visible { outline: none; }
.tab-btn:focus-visible::before { 
    content: ""; position: absolute; top: 0.25rem; left: -0.5rem; 
    right: -0.5rem; bottom: 0.25rem; border-radius: var(--radius-sm); 
    border: 2px solid var(--focus-ring-color); 
}

.service-content-wrapper { position: relative; min-height: 400px; }
.tab-panel { 
    display: none; opacity: 0; transform: translateY(10px); 
    transition: opacity 0.4s ease, transform 0.4s ease; 
}
.tab-panel.active { display: block; animation: fadeUp 0.5s forwards; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.panel-inner { display: flex; align-items: center; gap: 4rem; }
.panel-text { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
.panel-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-color); }
.panel-desc { font-size: 1rem; line-height: 1.7; color: var(--text-muted); margin-bottom: 1.5rem; text-align: justify; }
.panel-list { margin-bottom: 2rem; padding-left: 0; }
.panel-list li { position: relative; padding-left: 1.5rem; margin-bottom: 0.75rem; color: var(--text-color); font-weight: 500; }
.panel-list li::before { content: "✓"; position: absolute; left: 0; color: var(--primary-color); font-weight: bold; }
.panel-image { 
    flex: 1; width: 100%; border-radius: var(--radius-lg); overflow: hidden; 
    box-shadow: 0 1rem 3rem rgba(0,0,0,0.1); transform: translateZ(0); 
}
.panel-image img { width: 100%; height: auto; display: block; object-fit: cover; transition: transform 0.5s ease; }
.panel-image:hover img { transform: scale(1.05); }

/* =========================================
   7. InfoService & FAQ
   ========================================= */
.InfoService { 
    position: relative; 
    background-size: cover; background-position: center; background-attachment: fixed; color: var(--text-light); 
}
.InfoService::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.85); z-index: 1; }
.InfoService .container { position: relative; z-index: 2; }
.InfoService .section-title { color: var(--text-light); }
.InfoService .section-desc { color: var(--text-light-muted); }

.Faq { background-color: var(--bg-color); } 
.faq-tabs { display: flex; justify-content: center; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap; }
.faq-tab-btn { 
    padding: 0.75rem 2rem; border: 1px solid #ddd; background: transparent; 
    border-radius: 50px; font-size: 1rem; color: var(--text-muted); cursor: pointer; transition: all 0.3s ease; 
}
.faq-tab-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.faq-tab-btn.active { 
    background-color: var(--primary-color); color: #fff; 
    border-color: var(--primary-color); box-shadow: 0 4px 10px rgba(9, 132, 227, 0.3); 
}

.faq-list { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.faq-item { 
    background-color: var(--white); border-radius: 0.75rem; border: 1px solid rgba(0,0,0,0.05); 
    overflow: hidden; transition: all 0.3s ease; 
}
.faq-item.hidden { display: none; } 
.faq-question { 
    width: 100%; text-align: left; padding: 1.5rem 2rem; background: none; border: none; 
    display: flex; justify-content: space-between; align-items: center; cursor: pointer; 
    font-size: 1.125rem; font-weight: 700; color: var(--text-color); transition: background-color 0.3s; 
}
.faq-question:hover { background-color: rgba(0,0,0,0.02); }
.faq-question .icon { font-size: 1.5rem; font-weight: 300; transition: transform 0.3s ease; color: var(--primary-color); }
.faq-item.active { box-shadow: 0 10px 20px rgba(0,0,0,0.05); border-color: transparent; }
.faq-item.active .faq-question { color: var(--primary-color); background-color: rgba(9, 132, 227, 0.05); }
.faq-item.active .icon { transform: rotate(45deg); } 
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1); background-color: var(--white); }
.faq-answer .inner { padding: 1.5rem 2rem; color: var(--text-muted); line-height: 1.8; }

/* =========================================
   8. News 最新消息 (上圖下文)
   ========================================= */
.News { 
    position: relative; 
    background-image: url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80'); 
    background-size: cover; background-position: center; background-attachment: fixed; background-repeat: no-repeat;
    color: var(--text-light); 
}
.News::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.85); z-index: 1; }
.News .container { position: relative; z-index: 2; }
.News .section-title { color: var(--text-light); }
.News .section-desc { color: var(--text-light-muted); }

.news-tabs { display: flex; justify-content: center; gap: 1rem; margin-bottom: 3rem; }
.news-tab-btn { 
    padding: 0.5rem 1.5rem; border: none; background: transparent; font-size: 1rem; 
    color: var(--text-light-muted); cursor: pointer; position: relative; 
    transition: 0.3s; font-weight: 500; 
}
.news-tab-btn::after { 
    content: ''; position: absolute; bottom: 0; left: 50%; width: 0; height: 2px; 
    background-color: var(--primary-color); transition: all 0.3s ease; transform: translateX(-50%); 
}
.news-tab-btn:hover, .news-tab-btn.active { color: var(--primary-color); }
.news-tab-btn.active::after { width: 80%; }

.news-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-bottom: 3rem; }
.news-card { 
    display: flex; flex-direction: column; background-color: var(--white); 
    border-radius: var(--radius-md); overflow: hidden; transition: all 0.3s ease; 
    text-decoration: none; color: var(--text-color); height: 100%; border: none; 
	animation: 0.5s ease 0s 1 normal forwards running fadeUp;
}
.news-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.3); }
.news-card.hidden { display: none; }

.news-thumb { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; display: block; }
.news-card:hover .news-thumb img { transform: scale(1.1); }
.news-date { 
    position: absolute; top: 1rem; right: 1rem; background-color: rgba(255, 255, 255, 0.95); 
    padding: 0.4rem 0.8rem; border-radius: var(--radius-sm); text-align: center; 
    color: var(--text-color); font-family: 'Arial', sans-serif; box-shadow: 0 2px 5px rgba(0,0,0,0.1); z-index: 2; 
}
.news-date .day { display: block; font-size: 1.25rem; font-weight: 800; color: var(--primary-color); line-height: 1; }
.news-date .month { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.news-date .year { display: block; font-size: 1.25rem; font-weight: 800; color: var(--primary-color); line-height: 1; }

.news-content { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; text-align: left; }
.news-tag { 
    display: inline-block; font-size: 0.75rem; color: var(--primary-color); 
    border: 1px solid var(--primary-color); padding: 0.1rem 0.6rem; border-radius: 50px; 
    margin-bottom: 0.75rem; width: fit-content; font-weight: 600; 
}
.news-title { 
    font-size: 1.125rem; font-weight: 700; color: var(--text-color); margin-bottom: 0.75rem; 
    line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; 
}
.news-card:hover .news-title { color: var(--primary-color); }
.news-excerpt { 
    font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; 
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; 
    overflow: hidden; margin-bottom: 0; 
}
.news-more-btn-wrapper { text-align: center; }

/* =========================================
   9. Contact 聯絡我們 (布局層)
   ========================================= */
.Contact { background-color: var(--white); }
.contact-wrapper { display: flex; gap: 4rem; align-items: flex-start; margin-top: 3rem; }

.contact-info { flex: 1; }
.contact-sub-title { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); margin-bottom: 1.5rem; line-height: 1.4; }
.contact-text { font-size: 1rem; color: var(--text-muted); line-height: 1.8; margin-bottom: 2.5rem; text-align: justify; }

.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { display: flex; align-items: flex-start; margin-bottom: 2rem; }
.contact-list .icon { 
    width: 3rem; height: 3rem; background-color: rgba(9, 132, 227, 0.1); 
    color: var(--primary-color); border-radius: 50%; display: flex; align-items: center; 
    justify-content: center; font-size: 1.2rem; margin-right: 1.25rem; flex-shrink: 0; 
}
.contact-list .details { display: flex; flex-direction: column; }
.contact-list .label { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.contact-list .value { font-size: 1.125rem; color: var(--text-color); font-weight: 500; text-decoration: none; line-height: 1.4; }
.contact-list .value small { font-size: 0.9rem; color: var(--text-muted); }
.contact-list a.value:hover { color: var(--primary-color); text-decoration: underline; }

/* 表單外框容器 (內容樣式已移至 Style.css) */
.contact-form-wrapper { flex: 1; background-color: var(--bg-color); padding: 2.5rem; border-radius: var(--radius-lg); box-shadow: 0 10px 30px rgba(0,0,0,0.05); }

/* =========================================
   10. 首頁 RWD 響應式調整
   ========================================= */
@media (max-width: 62rem) { 
    .main-service-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
    .works-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
    .work-overlay { transform: translateY(0); padding: 1.5rem; background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 100%); }
    .item-main, .item-sub1, .item-sub2, .item-tall { grid-column: span 1; grid-row: span 1; aspect-ratio: 1/1; }
    .item-main, .item-tall { grid-column: 1 / -1; aspect-ratio: 16/9; }
    .panel-inner { flex-direction: column-reverse; gap: 2rem; }
    .news-list { grid-template-columns: repeat(2, 1fr); } 
    .contact-wrapper { flex-direction: column; gap: 3rem; }
    .contact-form-wrapper { width: 100%; padding: 2rem; }
}

@media (max-width: 48rem) {
    .main-service-grid, .works-bento { grid-template-columns: 1fr; }
    .main-service-card { padding: 2rem 1.5rem; }
    .about-wrapper { flex-direction: column; gap: 2rem; }
    .about-text, .section-desc { text-align: center; align-items: center; }
    .item-main, .item-sub1, .item-sub2, .item-tall { aspect-ratio: 4/3; }
    .service-tabs { justify-content: flex-start; overflow-x: auto; padding-bottom: 0.5rem; gap: 1rem; }
    .faq-tabs { gap: 0.5rem; } 
    .faq-tab-btn { padding: 0.5rem 1.25rem; font-size: 0.9rem; } 
    .faq-question { padding: 1.25rem; font-size: 1rem; } 
    .faq-answer .inner { padding: 0 1.25rem 1.5rem 1.25rem; }
    .news-list { grid-template-columns: 1fr; gap: 1.5rem; } 
    .news-content { padding: 1.25rem; }
    .video-pc { display: none; } 
    .video-mb { display: block; }
    .contact-sub-title { font-size: 1.25rem; }
    .contact-form-wrapper { padding: 1.5rem; }
    .contact-list .icon { width: 2.5rem; height: 2.5rem; font-size: 1rem; }
}
/* =========================================
   11. [新增] 首頁動畫延遲設定 (Stagger Delays)
   讓元素不要同時出現，而是依序出場
   ========================================= */

/* 通用：標題與內文的延遲 */
.section-title.ani-on-scroll { transition-delay: 0s; }
.section-desc.ani-on-scroll { transition-delay: 0.2s; }

/* MainService 卡片依序浮現 */
.main-service-card.ani-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.main-service-card.ani-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.main-service-card.ani-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.main-service-card.ani-on-scroll:nth-child(4) { transition-delay: 0.4s; }

/* Case 作品 Bento Grid 依序浮現 */
.works-bento .work-card.ani-on-scroll.item-main { transition-delay: 0.1s; }
.works-bento .work-card.ani-on-scroll.item-sub1 { transition-delay: 0.3s; }
.works-bento .work-card.ani-on-scroll.item-sub2 { transition-delay: 0.4s; }
.works-bento .work-card.ani-on-scroll.item-tall { transition-delay: 0.2s; }

/* News 新聞卡片依序浮現 */
.news-card.ani-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.news-card.ani-on-scroll:nth-child(2) { transition-delay: 0.25s; }
.news-card.ani-on-scroll:nth-child(3) { transition-delay: 0.4s; }