/* ========================================
   Design System - CSS Variables (Design Tokens)
   根據 docs/design_guidelines.md 設定
   ======================================== */

:root {
    /* 品牌企業色 (Brand Colors) */
    --primary-teal: #016D82;
    --hover-green: #004d4d;

    /* 中性色 (Neutral Colors) */
    --color-black: #000000;
    --color-gray-1: #9F9F9F;
    --color-gray-2: #D9D9D9;
    --color-white: #FFFFFF;

    /* 文字顏色 (Text Colors) */
    --color-text-primary: #000000;
    --color-text-secondary: #9F9F9F;
    --color-text-light: #D9D9D9;
    --color-text-white: #FFFFFF;

    /* 背景顏色 (Background Colors) */
    --color-bg-light: #F5F5F5;
    --color-bg-dark: #1a1a1a;
    --color-bg-white: #FFFFFF;
    --color-bg-gray: #D9D9D9;

    /* 間距系統 (Spacing Scale) */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 40px;
    --spacing-xl: 80px;
    --spacing-xxl: 120px;

    /* 字體大小 (Typography - rem based on 16px) */
    --font-size-hero: 4.5rem;
    /* 72px - 首頁 / 內頁 hero 主標 */
    --font-size-hero-sub: 1.5rem;
    /* 24px - 首頁 / 內頁 hero 副標 */
    --font-size-h1: 3rem;
    /* 48px */
    --font-size-h2: 2.5rem;
    /* 40px */
    --font-size-h3: 1.75rem;
    /* 28px */
    --font-size-h4: 1.5rem;
    /* 24px */
    --font-size-subheadline: 1.3125rem;
    /* 21px - 導言 / 副標 */
    --font-size-body: 1.125rem;
    /* 18px - 內文 */
    --font-size-small: 0.875rem;
    /* 14px */

    /* 行高 (Line Height) */
    --line-height-tight: 1.2;
    --line-height-normal: 1.6;
    --line-height-relaxed: 1.8;

    /* 邊框圓角 (Border Radius) */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;

    /* 過渡效果 (Transitions) */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* 字體系列 (Font Families) */
    /* Chinese (中文字體): Prioritize JP as requested, fallback to TC and system fonts to prevent Serif fallback */
    --font-family-chinese: 'Noto Sans JP', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
    /* English (英文字體): Chivo - Regular (400), Bold (700), Black (900) */
    --font-family-english: 'Chivo', sans-serif;
    /* Numeric (數字字體): Inter - "1" 無下襯線 */
    --font-family-numeric: 'Inter', sans-serif;
    /* Default fallback */
    --font-family-base: 'Noto Sans JP', 'Chivo', sans-serif;

    /* 容器最大寬度 (Container) */
    --container-max-width: 1600px;
}

/* Prevent horizontal scroll */
html,
body {
    overflow-x: hidden;
    width: 100%;
}

html {
    scroll-behavior: smooth;
}

p {
    line-height: var(--line-height-relaxed);
}

/* ========================================
   通用容器 (Container)
   ======================================== */

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    width: 100%;
}

/* ========================================
   通用區塊樣式 (Section)
   ======================================== */

section {
    position: relative;
    padding: var(--spacing-xl) 0;
}

section:first-of-type {
    padding-top: 0;
}

section:last-of-type {
    padding-bottom: calc(var(--spacing-xl) * 2);
}

/* ========================================
   通用按鈕組件 (Button Components)
   ======================================== */

/* 基礎按鈕樣式 */
.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    transition: var(--transition-normal);
    font-size: var(--font-size-body);
    cursor: pointer;
    border: none;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
}

/* More 按鈕 (箭頭按鈕) */
.btn-more {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 200px;
    height: 40px;
    /* Reduced from 50px */
    background-color: var(--primary-teal);
    /* Solid teal background */
    border: 1px solid var(--primary-teal);
    color: var(--color-text-white);
    /* White text */
    padding: 0 20pt;
    text-transform: uppercase;
    font-size: 0.875rem;
    font-weight: 500;
    overflow: hidden;
    cursor: pointer;
    transition: color 0.3s ease;
    text-decoration: none;
    /* Ensure no underline */
}

/* Static Teal Background */


/* Hover Green Fill */
.btn-more::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: var(--hover-green);
    transition: width 0.3s ease;
    z-index: 1;
}

.btn-more span {
    position: relative;
    z-index: 2;
}

.btn-more span:last-child {
    position: absolute;
    right: 20pt;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    z-index: 2;
}

@media (hover: hover) {
    .btn-more:hover {
        color: var(--color-text-white);
    }

    .btn-more:hover::after {
        width: 100%;
    }
}

/* ========================================
   通用導航按鈕 (Navigation Buttons)
   ======================================== */

.nav-btn {
    position: absolute;
    width: 50px;
    height: 50px;
    cursor: pointer;
    z-index: 2;
    transition: var(--transition-normal);
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--color-white);
    border-left: 2px solid var(--color-white);
    transition: var(--transition-normal);
}

@media (hover: hover) {
    .nav-btn:hover {
        opacity: 0.7;
    }
}

/* ========================================
   分頁組件 (Pagination)
   ======================================== */

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    width: 100%;
}

.pagination .page-item {
    flex-shrink: 0;
}

.pagination .page-link {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid #666666;
    color: #666666;
    text-decoration: none;
    transition: var(--transition-normal);
    font-family: 'Chivo', sans-serif;
    font-weight: 400;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-teal);
    border-color: var(--primary-teal);
    color: var(--color-white);
}

@media (hover: hover) {
    .pagination .page-link:not(.page-item.active .page-link):hover {
        border-color: var(--hover-green);
        color: var(--hover-green);
    }
}

/* Prev 及 Next 不要文字，只要箭頭 */
.pagination .page-prev,
.pagination .page-next {
    display: flex;
    align-items: center;
    text-indent: -9999px;
    position: relative;
}

.pagination .page-prev::after,
.pagination .page-next::after {
    content: "";
    display: block;
    width: 8px;
    height: 15px;
    background: currentColor;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.pagination .page-prev::after {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='15' viewBox='0 0 8 15' fill='none'%3E%3Cpolyline points='7 1 1 7.5 7 14' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='15' viewBox='0 0 8 15' fill='none'%3E%3Cpolyline points='7 1 1 7.5 7 14' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

.pagination .page-next::after {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='15' viewBox='0 0 8 15' fill='none'%3E%3Cpolyline points='1 1 7 7.5 1 14' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='15' viewBox='0 0 8 15' fill='none'%3E%3Cpolyline points='1 1 7 7.5 1 14' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* 手機版隱藏特定分頁項目 */
@media (max-width: 768px) {
    .pagination .for_pc {
        display: none;
    }
}

/* ========================================
   通用標題樣式 (Section Titles)
   ======================================== */

.section-title h2 {
    font-size: var(--font-size-h2);
    color: var(--color-black);
    margin-bottom: var(--spacing-lg);
    font-weight: 700;
    font-family: 'Noto Sans JP', sans-serif;
}

.section-label-large {
    font-family: 'Chivo', sans-serif;
    font-size: 6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1;
    pointer-events: none;
}

/* ========================================
   區塊標題（標題左 + 細線 + lead 右）共用元件
   各內頁可直接套用 .section-head；深色底用 .section-head--white
   ======================================== */
.section-head {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-bottom: 60px;
}

.section-head h2 {
    flex-shrink: 0;
    font-family: var(--font-family-chinese);
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    margin: 0;
    line-height: 1.2;
    color: var(--color-text-primary);
    border-left: 4px solid var(--primary-teal);
    padding-left: 20px;
}

.section-head .lead {
    flex: 1;
    max-width: 1040px;
    font-size: var(--font-size-subheadline);
    line-height: 1.7;
    color: var(--color-text-primary);
    margin: 0;
}

.section-head .lead .accent {
    color: var(--color-text-primary);
    font-weight: 500;
}

/* 反白變體（深色背景）：左側短線、標題、lead 內文皆改為白色 */
.section-head--white h2 {
    color: var(--color-white);
    border-left-color: var(--color-white);
}

.section-head--white .lead {
    color: rgba(255, 255, 255, 0.85);
}

.section-head--white .lead .accent {
    color: var(--color-white);
}

@media (max-width: 900px) {
    .section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 36px;
    }

    .section-head h2 {
        font-size: 2rem;
    }

    .section-head .lead {
        max-width: none;
    }
}

/* ========================================
   通用圖片容器 (Image Container)
   ======================================== */

.img-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========================================
   響應式設計 (Responsive Design)
   ======================================== */

/* 平板 */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-md);
    }

    .section-label-large {
        font-size: 4rem;
    }
}

/* 手機 */
@media (max-width: 768px) {
    :root {
        --font-size-hero: 2.5rem;
        /* 40px */
        --font-size-hero-sub: 1rem;
        /* 16px */
        --font-size-h1: 2rem;
        /* 32px */
        --font-size-h2: 1.5rem;
        /* 24px */
        --font-size-h3: 1.25rem;
        /* 20px */
        --font-size-h4: 1.125rem;
        /* 18px */
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    section {
        padding: var(--spacing-lg) 0;
    }

    .section-label-large {
        font-size: 3rem;
    }

    .btn-more {
        width: 140pt;
        height: 26pt;
        font-size: 0.8rem;
    }

}

/* ========================================
   Back to Top Button
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 30px;
    /* Reduced by 25% */
    height: 53px;
    /* Reduced by 25% */
    background-color: #6b6b6b;
    background-image: none;
    border: none;
    border-radius: 0;
    cursor: pointer;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 11px;
    /* Reduced by 25% */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);

    /* New Hover Effect Setup */
    overflow: hidden;
}

.back-to-top::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background-color: #3a3a3a;
    transition: height 0.3s ease;
    z-index: 1;
}

.back-to-top .arrow {
    position: relative;
    width: 18px;
    /* Reduced by 25% */
    height: 11px;
    /* Reduced by 25% */
    margin-bottom: 4px;
    /* Reduced by 25% */
    z-index: 2;
}

.back-to-top .arrow::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    /* Reduced by 25% */
    height: 9px;
    /* Reduced by 25% */
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    transform: translate(-50%, -25%) rotate(45deg);
}

.back-to-top .text {
    font-family: 'Chivo', sans-serif;
    color: #fff;
    font-size: 0.75rem;
    /* Reduced by 25% */
    font-weight: 500;
    line-height: 1;
    position: relative;
    z-index: 2;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    opacity: 1;
}

.back-to-top:hover::after {
    height: 100%;
}

/* Utility to stop animations during resize */
.resize-animation-stopper * {
    animation: none !important;
    transition: none !important;
}

/* ========================================
   通用 Hero Banner (Common Hero Banner)
   ======================================== */

.hero-banner {
    height: 85vh;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    text-align: left;
    /* Default left align */
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.hero-banner .container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-banner h1 {
    font-size: var(--font-size-hero);
    line-height: 1.1;
    color: #fff;
    font-weight: 700;
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-family: var(--font-family-english);
}

.hero-banner .divider {
    width: 80px;
    height: 4px;
    background-color: #fff;
    margin-bottom: 30px;
}

.hero-banner p {
    color: #fff;
    font-size: var(--font-size-hero-sub);
    letter-spacing: 2px;
    line-height: 1.6;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* ========================================
   內頁 Hero (Page Hero)
   各內頁套用 .page-hero.hero-fullbleed，
   背景圖在頁面 CSS 用 .page-hero.hero-fullbleed::before { background-image: url(...) } 覆寫
   ======================================== */

.page-hero {
    position: relative;
    width: 100%;
    color: var(--color-white);
    overflow: hidden;
}

.page-hero .container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 變體：滿版圖 + 底部對齊大字 */
.page-hero.hero-fullbleed {
    height: 55vh;
    min-height: 460px;
    background: var(--hover-green);
}

.page-hero.hero-fullbleed::before {
    content: "";
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: 0;
}

.page-hero.hero-fullbleed::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(0, 60, 60, 0.5) 0%,
            rgba(0, 60, 60, 0.85) 100%);
    z-index: 1;
}

.page-hero.hero-fullbleed .container {
    /* 內容以絕對定位釘在 hero 底部，留白由 padding-bottom 提供。
       不依賴 height:100% / justify-content / margin-top:auto —
       這些在 height:55vh 與 min-height 並存時，百分比與 flex 餘量解析會逐頁飄移，
       導致標題位子不固定；絕對定位 bottom:0 則在所有頁面/視窗一致。 */
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding-bottom: 80px;
}

.page-hero.hero-fullbleed .divider {
    width: 80px;
    height: 4px;
    background-color: var(--color-white);
    margin: 24px 0;
}

.page-hero.hero-fullbleed .big-en {
    font-family: var(--font-family-chinese);
    font-size: 3.25rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.18em;
    color: var(--color-white);
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.page-hero.hero-fullbleed .zh-tag {
    font-family: var(--font-family-chinese);
    font-size: 1rem;
    line-height: 1.7;
    letter-spacing: 1.5px;
    margin: 0;
    color: var(--color-white);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1024px) {
    .page-hero.hero-fullbleed { min-height: 400px; }
    .page-hero.hero-fullbleed .container { padding-bottom: 64px; }
    .page-hero.hero-fullbleed .big-en { font-size: 2.5rem; letter-spacing: 0.14em; }
}

@media (max-width: 768px) {
    .page-hero.hero-fullbleed { min-height: 340px; }
    .page-hero.hero-fullbleed .container { padding-bottom: 40px; }
    .page-hero.hero-fullbleed .divider { margin: 16px 0; width: 60px; height: 3px; }
    .page-hero.hero-fullbleed .big-en { font-size: 2rem; letter-spacing: 0.1em; }
    .page-hero.hero-fullbleed .zh-tag { letter-spacing: 1px; font-size: 0.9rem; }

    /* 首頁 hero 手機改 min-height 並避免 100vh 在 mobile chrome address bar 浮動下跳動 */
    .hero-banner {
        height: auto;
        min-height: 78vh;
        align-items: center;
        justify-content: center;
    }

    .hero-banner .container {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* ========================================================
   共用組件：副標長文 intro-block
   左側 Venn 三圓（永續/設計/智能 等核心理念）+ 右側段落
   使用：about_us / about_system 等內頁
   ======================================================== */
.intro-block {
    padding: 160px 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)),
        url("../images/about_us/intro_bg.jpg") center/cover no-repeat,
        var(--color-white);
}

.intro-block .intro-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 48px;
}

.intro-block .intro-label h2.core-trio {
    position: relative;
    width: 400px;
    height: 380px;
    margin: 0;
    display: block;
    font-family: var(--font-family-chinese);
}

.intro-block .trio-item {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(1, 109, 130, 0.78);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--color-white);
    opacity: 0;
}

/* 入場初始狀態：三圓收攏在容器中央 + 縮小旋轉 */
.intro-block .trio-item:nth-child(1) {
    top: 0;
    left: 0;
    transform: translate(90px, 80px) scale(0.35) rotate(-180deg);
}

.intro-block .trio-item:nth-child(3) {
    top: 0;
    right: 0;
    transform: translate(-90px, 80px) scale(0.35) rotate(-180deg);
}

.intro-block .trio-item:nth-child(5) {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-80px) scale(0.35) rotate(180deg);
}

/* 進入視窗：入場散開（一次性） */
.intro-block .core-trio.is-visible .trio-item:nth-child(1) {
    animation: orb-enter-1 1.4s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.intro-block .core-trio.is-visible .trio-item:nth-child(3) {
    animation: orb-enter-3 1.4s cubic-bezier(0.2, 0.9, 0.3, 1) 0.15s forwards;
}

.intro-block .core-trio.is-visible .trio-item:nth-child(5) {
    animation: orb-enter-5 1.4s cubic-bezier(0.2, 0.9, 0.3, 1) 0.3s forwards;
}

/* 入場完成後：固定終態 + 接續呼吸動畫 */
.intro-block .core-trio.entered .trio-item:nth-child(1),
.intro-block .core-trio.entered .trio-item:nth-child(3) {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 1;
    animation: orb-breathe 4.5s ease-in-out infinite;
}

.intro-block .core-trio.entered .trio-item:nth-child(3) {
    animation-delay: 0.15s;
}

.intro-block .core-trio.entered .trio-item:nth-child(5) {
    transform: translateX(-50%) translateY(0) scale(1) rotate(0deg);
    opacity: 1;
    animation: orb-breathe-center 4.5s ease-in-out 0.3s infinite;
}

.intro-block .trio-item i {
    font-size: 1.85rem;
    color: var(--color-white);
}

.intro-block .trio-item .word {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--color-white);
}

.intro-block .intro-label h2 .x {
    display: none;
}

.intro-block .intro-text {
    text-align: left;
    max-width: 720px;
    flex-shrink: 1;
}

.intro-block .intro-text p {
    font-size: var(--font-size-body);
    line-height: 1.8;
    color: var(--color-text-primary);
    margin: 0 0 1.4em;
}

/* 三圓圈版型（僅 about_us / about_system；服務頁的 .intro-quote 不受影響）
   說明文字放大到與標題旁 lead 同級 */
.intro-block .intro-text:not(.intro-quote) p {
    font-size: var(--font-size-subheadline);
}

.intro-block .intro-text p:last-child {
    margin-bottom: 0;
}

.intro-block .intro-text .accent {
    color: var(--color-text-primary);
    font-weight: 500;
}

.intro-block .intro-text .accent-brand {
    color: var(--primary-teal);
    font-weight: 500;
}

.intro-block .intro-text .accent-dim {
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--primary-teal);
    padding-bottom: 1px;
}

/* 引言版型（5 個服務頁：architecture / construction / interior / ipd / tech）
   .intro-grid 內單一置中引言，無圓圈；字級沿用 .intro-text p（18px），左上開、右下收引號 */
.intro-block .intro-quote {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    padding: 64px 56px;
}

.intro-block .intro-quote::before,
.intro-block .intro-quote::after {
    position: absolute;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 2.75rem;
    line-height: 1;
    color: var(--primary-teal);
    opacity: 0.85;
}

.intro-block .intro-quote::before {
    content: '\f10d';
    top: 0;
    left: 0;
}

.intro-block .intro-quote::after {
    content: '\f10e';
    bottom: 0;
    right: 0;
}

@keyframes orb-enter-1 {
    0%   { transform: translate(90px, 80px) scale(0.35) rotate(-180deg); opacity: 0; }
    60%  { opacity: 1; }
    100% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 1; }
}

@keyframes orb-enter-3 {
    0%   { transform: translate(-90px, 80px) scale(0.35) rotate(-180deg); opacity: 0; }
    60%  { opacity: 1; }
    100% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 1; }
}

@keyframes orb-enter-5 {
    0%   { transform: translateX(-50%) translateY(-80px) scale(0.35) rotate(180deg); opacity: 0; }
    60%  { opacity: 1; }
    100% { transform: translateX(-50%) translateY(0) scale(1) rotate(0deg); opacity: 1; }
}

@keyframes orb-breathe {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    50%      { transform: translate(0, 0) scale(1.04) rotate(0deg); }
}

@keyframes orb-breathe-center {
    0%, 100% { transform: translateX(-50%) translateY(0) scale(1) rotate(0deg); }
    50%      { transform: translateX(-50%) translateY(0) scale(1.04) rotate(0deg); }
}

@media (max-width: 1024px) {
    .intro-block { padding: 100px 0; }
    .intro-block .intro-grid { flex-direction: column; gap: 40px; }
}

@media (max-width: 768px) {
    .intro-block { padding: 60px 0; }
    .intro-block .intro-grid { flex-direction: column; gap: 32px; }
    .intro-block .intro-text p { font-size: var(--font-size-body); line-height: 1.9; overflow-wrap: anywhere; word-break: break-word; }
    .intro-block .intro-label h2.core-trio { width: 290px; height: 275px; }
    .intro-block .trio-item { width: 160px; height: 160px; }
    .intro-block .trio-item i { font-size: 1.4rem; }
    .intro-block .trio-item .word { font-size: 0.95rem; }
    .intro-block .intro-text { text-align: left; max-width: 100%; margin-left: 0; }
}


/* ============================================================
   以下內容由 services.css 搬移併入（services 頁面共用樣式）
   ============================================================ */
/* ========================================
   Services Page Styles
   ======================================== */

/* Services Hero */
.service_hero {
    background-image: url('../images/service/service_hero1.jpg');
}

.service_hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
}

.service_hero .container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.service_hero h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    color: #fff;
    margin-bottom: 20px;
    font-family: 'Chivo', sans-serif;
    font-weight: 900;
}

.service_hero p {
    color: #fff;
    font-size: 1.5rem;
    letter-spacing: 2px;
    line-height: 1.6;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.divider {
    width: 100px;
    height: 4px;
    background-color: #fff;
    margin-bottom: 30px;
}

/* IPD Process Section */
.ipd_process_section {
    padding: 100px 0;
    background-color: #ffffff;
}

.construction_process_section {
    padding: 100px 0;
    background-color: #ffffff;
}

.process_layout {
    display: flex;
    align-items: center;
    gap: 60px;
}

.process_content {
    flex: 1;
}

.process_content h2 {
    font-size: 2.5rem;
    color: var(--primary-teal);
    margin-bottom: 50px;
    font-weight: 700;
    font-family: var(--font-family-chinese);
    line-height: 1.5;
}

.process_steps {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.step_item {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.step_number {
    font-family: 'Chivo', sans-serif;
    font-size: 3rem;
    font-weight: 400;
    color: #D9D9D9;
    line-height: 1;
    min-width: 60px;
}

.step_info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-teal);
    margin-bottom: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.step_info p {
    font-size: var(--font-size-body);
    line-height: 1.6;
    color: #666;
    margin-bottom: 0;
}

.step_divider {
    width: 100%;
    height: 1px;
    background-color: #ddd;
    margin-top: 40px;
}

.step_item:last-child .step_divider {
    display: none;
}

.process_image {
    flex: 1;
    position: relative;
    height: 600px;
}

.process_image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.process_image_inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.process_image_overlay {
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 60%;
    height: 60%;
    z-index: 2;
    border: 10px solid #F9F7F2;
    overflow: hidden;
    display: none;
}

/* Project Tabs */
.project_tabs {
    display: flex;
    justify-content: center;
    /* Center align like expertise */
    width: 100%;
    margin-bottom: 50px;
    gap: 80px;
    /* Add gap between tabs */
    border-bottom: 1px solid #eee;
    /* Add bottom border to container like expertise */
}

.tab_btn {
    /* Remove flex: 1 to stop filling width */
    text-align: center;
    padding: 15px 30px;
    /* Specific padding */
    font-size: 1.1rem;
    background: transparent;
    border: none;
    /* Remove default border-bottom from all tabs, only active has it or container has it */
    /* border-bottom: 1px solid #E5E5E5;  <-- Removed per expertise style */
    color: #999;
    /* Standard gray for inactive */
    cursor: pointer;
    position: relative;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    /* Medium for inactive */
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tab_btn.active {
    color: var(--primary-teal);
    font-weight: 700;
    /* Bold for active */
    /* Use border-bottom on active element to simulate the underline */
    border-bottom: 3px solid var(--primary-teal);
    margin-bottom: -1px;
    /* Overlap container border */
}

.tab_btn:hover {
    color: var(--primary-teal);
}

/* Project Cases Section */
.project_cases_section {
    padding: 130px 0;
    background-color: #F4F4F4;
}

.project_grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
}

.project_card {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    position: relative;
    cursor: pointer;
}

.project_image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin-bottom: 30px;
}

.project_image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

@media (hover: hover) {
    .project_card:hover .project_image img {
        transform: scale(1.05);
    }
}

.project_content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 0 30px 30px 30px;
}

/* Base h3 styles for compatibility, but card-title takes precedence for structure */
.project_content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #b0b0b0;
    letter-spacing: 1px;
    line-height: 1.5;
    width: 100%;
}

/* New Logic for IPD Cards */
.card-title-wrapper {
    width: 100%;
    margin-bottom: 14px;
}

/* 卡片標籤群組（支援多個 tag，自動換行） */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin-bottom: 18px;
}

/* 卡片標籤 */
.card-tag {
    display: inline-block;
    font-family: 'Chivo', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-teal);
    border: 1px solid var(--primary-teal);
    padding: 5px 12px;
}

/* 卡片分隔線 */
.card-divider {
    width: 100%;
    height: 1px;
    background-color: #b0b0b0;
    margin-bottom: 25px;
}

.card-title {
    /* Reset layout properties managed by wrapper */
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;

    /* Font styles */
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    letter-spacing: 1px;
    line-height: 1.5;

    /* Strict Truncation */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 3.6rem;
    /* 1.2rem * 1.5 * 2 lines */
    max-height: 3.6rem;
}

.project_content p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.8;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project_content .btn-more {
    margin-top: auto;
}

/* ========================================
   Pagination Styles
   ======================================== */

.pagination_container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 80px;
}

.pagination_numbers {
    display: flex;
    gap: 15px;
    align-items: center;
}

.pagination_numbers a {
    display: inline-block;
    padding: 10px 8px;
    border: none;
    color: #666666;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Chivo', sans-serif;
    font-weight: 400;
}

.pagination_numbers a.active {
    background-color: var(--primary-teal);
    color: #fff;
    padding: 10px 16px;
}

.pagination_numbers a:hover:not(.active) {
    color: var(--hover-green);
}

.pagination_btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid #666666;
    color: #666666;
    text-decoration: none;
    font-family: 'Chivo', sans-serif;
    font-weight: 400;
    transition: all 0.3s ease;
}

.pagination_btn:hover {
    border-color: var(--hover-green);
    color: var(--hover-green);
}

.mobile-page-counter {
    display: none;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 900px) {
    .process_layout {
        flex-direction: column;
    }

    .process_image {
        width: 100%;
        height: 400px;
        order: -1;
    }

    .project_grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .service_hero h1 {
        font-size: 3rem;
    }

    .service_hero p {
        font-size: 1.2rem;
    }

    .ipd_process_section {
        padding: 50px 0 !important;
    }

    .pagination_container {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 50px;
        width: calc(100% + 40px);
        max-width: none;
        margin: 80px -20px 0;
        padding: 0 20px;
    }

    .pagination_numbers {
        display: flex;
        width: 100%;
        justify-content: space-between;
        order: -1;
        margin-bottom: 0;
        padding: 0;
    }

    .pagination_btn {
        width: 120px;
        justify-content: center;
    }

    .mobile-page-counter {
        display: none;
    }
}

/* ========================================
   共用 — 垂直時間軸區塊（深色底）
   套用：services_ipd 六大階段、services_construction 代理實施
   ======================================== */
.v2-timeline {
    padding: 130px 0;
    background: #1a3a37;
    color: var(--color-white);
    position: relative;
    overflow: hidden;
}

.v2-timeline::before {
    content: '';
    position: absolute;
    inset: -60% 0;
    background-image: url("../images/service_ipd/timeline_bg.jpg");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.35;
    z-index: 0;
    /* JS 滾動視差（.has-parallax 區塊透過 --parallax-y 位移底圖），
       桌機與手機行為一致；不用 background-attachment: fixed 以避開 iOS 問題 */
    transform: translate3d(0, var(--parallax-y, 0px), 0);
    will-change: transform;
}

.v2-timeline::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(26, 58, 55, 0.7) 0%,
            rgba(26, 58, 55, 0.9) 100%);
    z-index: 0;
}

.v2-timeline .container {
    position: relative;
    z-index: 1;
}

.v2-timeline .timeline-list {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    padding-left: 60px;
}

.v2-timeline .timeline-list::before {
    content: '';
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 12px;
    width: 1px;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.4) 0%,
            rgba(255, 255, 255, 0.1) 100%);
}

.v2-timeline .timeline-item {
    position: relative;
    padding: 0 0 28px 0;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    align-items: center;
}

.v2-timeline .timeline-item:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.v2-timeline .timeline-item::before {
    content: '';
    position: absolute;
    top: 6px;
    left: -58px;
    width: 18px;
    height: 18px;
    background: var(--color-white);
    border: 4px solid var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25), 0 0 16px rgba(1, 109, 130, 0.6);
    border-radius: 50%;
}

.v2-timeline .timeline-item .ti-num {
    font-family: var(--font-family-numeric);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
    margin-bottom: 8px;
}

.v2-timeline .timeline-item .ti-title {
    font-family: var(--font-family-chinese);
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--color-white);
    line-height: 1.3;
    letter-spacing: 0.05em;
    margin: 0;
}

.v2-timeline .timeline-item .ti-desc {
    font-size: 0.95rem;
    line-height: 1.95;
    color: rgba(255, 255, 255, 0.72);
    margin: 0 0 18px;
}

/* 可選：以多維度條列取代單一內文（例如 3D–10D 流程）。
   含 .ti-body 的項目改為頂端對齊，使左欄編號／標題對齊條列首行。 */
.v2-timeline .timeline-item:has(.ti-body) {
    align-items: start;
}

.v2-timeline .timeline-item .ti-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.v2-timeline .timeline-item .ti-line {
    margin: 0;
    font-family: var(--font-family-chinese);
    font-size: var(--font-size-body);
    line-height: 1.85;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 1024px) {
    .v2-timeline .timeline-item {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* 編號與小標題之間保留間距（避免上下黏太近）；
       小標題到內文的間距由 grid gap 提供 */
    .v2-timeline .timeline-item .ti-num {
        margin-bottom: 8px;
    }

    .v2-timeline .timeline-item .ti-title {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .v2-timeline .timeline-list {
        padding-left: 36px;
    }

    .v2-timeline .timeline-item::before {
        left: -30px;
    }

    .v2-timeline .timeline-item .ti-title {
        font-size: 1.25rem;
    }
}