:root {
    --bg-pink: #FEECEF;
    --main-pink: #E58B9D;
    --dark-pink: #F6B5C0;
    --white: #FFFFFF;
    --text-gray: #555;
    --text-light: #888;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }


body { 
    font-family: 'Montserrat', 'Noto Sans TC', sans-serif;
    color: var(--text-gray);
    line-height: 1.8;
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    /* 移除 overflow-x: hidden; 這樣手機上才能自由左右滑動縮放 */
}

.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* --- SECTION 0: HEADER BROWSER --- */
/* 這裡改為獨立背景，佈滿整個 Header 區域 */
.page-header {
    width: 100vw;           /* 強制寬度為視窗的 100% */
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;    
    margin-right: -50vw;
    
    background-image: url('img/hero-bg.png'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    min-height: 700px; /* 參考首頁作法：改用固定像素，避免手機縮小畫面時因 100vh 顯得比例太長 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    border-radius: 0;
}

.browser-window {
    background: #fff;
    border: 2px solid var(--dark-pink);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    width: 100%;                     /* 讓寬度自適應容器 */
    max-width: 850px;                /* 限制最大寬度，避免電腦版顯得過寬 */
    margin: 0 auto;                  /* 確保水平置中 */
}

.browser-bar {
    padding: 15px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--dark-pink);
}

.dots { display: flex; gap: 8px; margin-right: 20px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--dark-pink); }
.browser-title { max-width: 250px; margin: 0 auto; }

.nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 30px;
}

.nav-item {
    background: #fff;
    border: 1.5px dashed var(--main-pink);
    padding: 15px;
    border-radius: 15px;
    text-decoration: none;
    color: var(--main-pink);
    font-weight: bold;
    transition: 0.3s;
}
.nav-item:hover { transform: scale(1.05); background: var(--bg-pink); }
.nav-item span { display: block; font-size: 0.7rem; font-weight: normal; }

/* --- 通用 Section 背景設定 --- */
.section { 
    padding: 100px 0; /* 增加間距，讓每區背景更有層次 */
    position: relative; 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* --- SECTION 1: GRAPHIC DESIGN --- */
/* --- 1. 平面設計 SECTION (重疊效果) --- */
#graphic {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow: hidden;
    background-image: url('img/graphic-bg.png');
   
    background-position: top center;
    background-size: 100% auto; /* 寬度撐滿，高度自動 */
    
    z-index: 2;
    padding-top: 56.25%; 
    padding-bottom: 750px; 
}
.peek-character {
    position: sticky; 
    top: 100px;         
    left: 300vw;
    /* 2. 層級設定：必須大於 content-wrapper */
    z-index: 999;       
    
    /* 3. 強制推向最右邊 */
    float: right;
    margin-right: -20px; /* 稍微往右推一點，製造探頭感 */
    
    /* 4. 尺寸 */
    width: 250px; 
    height: auto;
    
    /* 5. 初始位移（隱藏一半） */
    transform: translateX(10%) rotate(-5deg);
    
    /* 6. 動畫觸發 */
    animation: peekAnimation 3s infinite ease-in-out;
    
    /* 防止擋住點擊內容 */
    pointer-events: none; 
}

@keyframes peekAnimation {
    0%, 100% {
        transform: translateX(10%) rotate(-5deg);
    }
    50% {
        transform: translateX(5%) rotate(-3deg);
    }
}
.graphic-content-wrapper {
    position: absolute; /* 絕對定位 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding-top: 50px; /* 調整這個數值，讓標題回到你想要的位置 */
    z-index: 1;

}


.sec-title-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
  
}
.sec-title-img { max-width: 320px; }
.sw-icons { display: flex; gap: 12px; }
.sw-icons img { width: 42px; height: 42px; border-radius: 8px; }

.intro-flex {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-bottom: 50px;
}
.intro-text { flex: 1.5; }
.intro-zh { font-size: 1.05rem; margin-bottom: 15px; text-align: justify; line-height: 1.8; }
.intro-en { font-size: 0.85rem; color: #888; font-style: italic; line-height: 1.6; }
.intro-side-img { flex: 1; width: 100%; border-radius: 20px; box-shadow: 0 10px 20px rgba(0,0,0,0.05); }

/* 圖片網格 (3+4 佈局) */
.grid-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; }
.grid-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.gallery-img { width: 100%; border-radius: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: 0.3s; }
.gallery-img:hover { transform: scale(1.03); }

/* --- 2. 網頁設計 SECTION --- */
#web {
    background-color: #FFF0F3; /* 替換網頁設計背景圖 */
    background-size: cover;
    background-position: center;
    padding: 100px 0;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;

    /* 4. 增加上下內距，讓內容與邊緣有呼吸空間 */
    padding: 100px 0;
    
    /* 確保與上方區塊的銜接自然 */
    z-index: 1;
}

.web-flow-container {
    /* 保持原本的容器外框與陰影設計 */
    background: rgba(255, 255, 255, 0.8);
    padding: 20px; /* 縮小內距，讓圖片成為主角 */
    border-radius: 60px;
    margin: 40px 0;
    border: 1.5px solid var(--dark-pink);
    text-align: center; /* 確保圖片置中 */
    display: flex;
    justify-content: center;
    align-items: center;
}

.web-flow-img {
    width: 100%;       /* 寬度撐滿容器 */
    max-width: 900px;  /* 限制最大寬度，避免電腦版圖片太大 */
    height: auto;      /* 高度自動縮放，不變形 */
    border-radius: 40px; /* 如果你的圖片本身沒有圓角，可以在這裡加 */
}
.web-showcase { width: 100%; border-radius: 30px; box-shadow: 0 20px 50px rgba(0,0,0,0.1); }

/* --- 軟體開發 SECTION --- */
#software {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background-color: #FFFFFF; /* 保持白色底 */
    padding: 80px 0;
}

/* --- AI 應用 SECTION (淺粉色背景) --- */
#ai-application {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background-color: #FFF0F3; /* 淺粉色背景 */
    padding: 80px 0;
}

.section-tag {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
}

.section-tag h2 {
    font-size: 2.2rem;
    color: var(--main-pink);
}

.section-tag span {
    font-size: 1rem;
    color: #888;
    font-weight: normal;
}

/* 軟體開發的 1x2 網格 */
.software-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.software-card {
    text-align: center;
}

.software-card img.main-preview {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.software-card h3 {
    font-size: 1.5rem;
    color: #555;
    margin-bottom: 5px;
}

.software-card p {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.tech-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.tech-badges img {
    height: 35px;
}

/* AI 應用的垂直長版卡片 */
.ai-card {
    background: #FFFFFF;
    border-radius: 30px;
    padding: 40px;
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.02);
}

.ai-card-reverse {
    flex-direction: row-reverse;
}

.ai-preview-box {
    flex: 1;
}

.ai-preview-box img {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #eee;
}

.ai-info-box {
    flex: 1.2;
}

.ai-info-box h3 {
    color: var(--main-pink);
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.ai-info-box h4 {
    color: var(--main-pink);
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 15px;
}

.ai-info-box p {
    font-size: 0.95rem;
    line-height: 1.7;
    text-align: justify;
}

/* =========================================
   可點擊圖片的提示標籤 (Click Hint Link)
   ========================================= */
.click-hint-link {
    position: relative;
    display: block;
    width: 100%;
    height: fit-content;
}
.intro-flex .click-hint-link { flex: 1; } /* 針對平面設計並排區塊的尺寸修正 */
.software-card .click-hint-link { margin-bottom: 20px; } /* 修正軟體卡片圖片下的間距 */
.software-card .click-hint-link img.main-preview { margin-bottom: 0; }

.click-hint-link::after {
    content: 'Click to View';
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(237, 176, 188, 0.95); /* 品牌粉色帶微透明 */
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: 'Montserrat', 'Noto Sans TC', sans-serif;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    pointer-events: none; /* 確保不會擋住使用者的點擊 */
    opacity: 0.85;
    transition: all 0.3s ease;
    z-index: 10;
}
.click-hint-link:hover::after {
    opacity: 1;
    background: #d17586;
    transform: scale(1.05) translateY(-2px); /* 滑鼠移過去時微放大上浮 */
}

/* =========================================
   回到頂部按鈕 (Back to Top)
   ========================================= */
   .back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background-color: var(--main-pink);
    color: white;
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(229, 139, 157, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999; /* 確保按鈕永遠在最上層 */
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    transform: translateY(-5px); /* 滑鼠移入稍微上浮 */
    background-color: #d17586; /* 稍微變深的粉紅色 */
}

/* =========================================
   修正：強制鎖定滿版區塊在手機上維持電腦版尺寸
   解決 100vw 導致高度縮水、內部內容超過顯示範圍的問題
   ========================================= */
@media (max-width: 1024px) {
    /* 1. 在手機版隱藏探頭小動畫 */
    .peek-character {
        display: none;
    }

    /* 2. 強制鎖定滿版區塊，避免手機寬度縮水 */
    .page-header, 
    #graphic, 
    #web, 
    #software, 
    #ai-application {
        width: 1024px;
        margin-left: -512px;
        margin-right: -512px;
    }

    /* 3. 解決平面設計區塊改為固定寬度後產生的底部空白問題 */
    #graphic {
        padding-top: 0;
        padding-bottom: 80px; 
    }
    .graphic-content-wrapper {
        position: relative;
        height: auto;
    }
    
    /* 4. 強制內容容器不縮水，解決左側文字被擠壓變長的問題 */
    .container {
        min-width: 1000px;
    }
}


/* =========================================
   手機版專屬放大設定 (參考 style.css 的作法)
   維持排版完全不變，僅針對觸控螢幕稍微放大按鈕
   ========================================= */
@media (max-device-width: 896px), (pointer: coarse) {
    .nav-item {
        padding: 20px;
        font-size: 1.1rem;
    }
    .nav-item span {
        font-size: 0.85rem;
    }
}
