/* --- 基礎重置與字體設定 --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    min-height: 100vh;
    font-family: 'Helvetica Neue', Arial, 'LiHei Pro', '微軟正黑體', sans-serif; 
    background-color: #fbfcf7; /* 淺白背景跟插畫人物背景同色系 */
    display: flex;
    flex-direction: column;
}
/* --- 防拷貝與防拖曳設定 --- */
body {
    /* 禁止反白選取文字 */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE10+/Edge */
    user-select: none;         /* Standard */
}

img {
    /* 禁止游標拖曳圖片到桌面 */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

/* (選擇性) 如果你未來有放「聯絡我」的表單，要讓 input 可以正常輸入與選取 */
input, textarea {
    -webkit-user-select: auto;
    user-select: auto;
}

/* --- 頁首 (Header) --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color:  #363636; /* 原先白色改成炭灰色 Header */
    z-index: 100;
    position: relative;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #ffffff; /* 原先黑色改成白色 */
    text-decoration: none; /* 關鍵：消除底線 */
    border: none;          /* 確保沒有框線 */
    display: inline-block;
}

/* 為了防止「點過連結後」變成紫色 (Visited color) */
.logo:link, 
.logo:visited, 
.logo:hover, 
.logo:active {
    color: #ffffff;       /* 強制所有狀態都是白色 */
    text-decoration: none; /* 強制所有狀態都沒有底線 */
}

nav a {
    text-decoration: none;
    color: #f5f5f5; /* 連結改為原本的淺灰色背景色碼 */
    margin-left: 30px;
    font-size: 16px;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #C98D91; /* 滑過時變為柔霧玫瑰紅 */
}

/* 當前頁面永遠保持這個顏色 */
nav a.current-page {
    color: #C98D91;
    font-weight: bold; /* 你甚至可以多加一個粗體，讓它更明顯 */
}

/* --- 漢堡按鈕基礎設定 (桌機版隱藏) --- */
.hamburger {
    display: none; /* 桌機版不顯示 */
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

/* 畫出三條白線 */
.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #ffffff; /* 變成白色的線 */
    margin: 5px 0;
    transition: 0.3s ease; /* 讓之後變成叉叉有動畫效果 */
}

/* --- 核心內容區塊 (Main)  --- */
.main-content-wrapper {
    flex-grow: 1;
    position: relative;
    overflow: hidden; 
    display: flex;
    justify-content: center; 
    align-items: center; 
    gap: 0; 
    padding: 0 5%; 
}

/* --- 左側文字群組 --- */
.text-group-left {
    display: flex;
    flex-direction: column; 
    align-items: flex-start; 
    z-index: 30;
}

/* --- Design 與 Portfolio 大字體 --- */
.text-design, .text-portfolio {
    font-family: 'Caveat Brush', cursive; 
    font-size: 15vw; 
    color: rgba(0, 0, 0, 0.7);
    white-space: nowrap;
    line-height: 0.85; 
    transition: transform 0.3s ease, color 0.3s ease; 
    pointer-events: auto; 
    cursor: default;
}

/* 初始位置 */
.text-design {
    margin-bottom: 0; 
    transform: translateX(-1vw); /* 原本是 -4vw，改為 -1vw 或是 0 */ 
}
.text-portfolio {
    transform: translateX(0); /* 原本是 -2vw，改為 0 */
}

/* 滑鼠移過去的互動效果 (Hover) */
.text-design:hover {
    transform: translateX(-7vw) scale(1.02); 
    color: rgba(0, 0, 0, 0.9); 
}
.text-portfolio:hover {
    transform: translateX(-5vw) scale(1.02); 
    color: rgba(0, 0, 0, 0.9); 
}

/* --- 年份文字 --- */
.text-year {
    font-family: 'Comic Relief', Arial, 'LiHei Pro', '微軟正黑體', sans-serif;
    font-size: 18px; 
    color: #979797; 
    font-weight: bold;
    letter-spacing: 3px; 
    margin-top: 30px; 
    padding-left: 10px; 
}

/* --- 右側插畫人物 --- */
.character-right {
    z-index: 20;
    display: flex;
    align-items: flex-end;  
    align-self: stretch;
    margin-left: -4vw;
}

.mini-character-video { 
    height: 85vh; 
    width: auto;
    object-fit: contain;
    display: block;
}

/* --- 頁尾 (Footer) --- */
footer {
    text-align: center;
    padding: 20px;
    font-size: 14px;
    background-color: #363636; 
    color: #f5f5f5; 
    z-index: 100;
    position: relative;
}

/* ============ 關於我 (About) 頁面專屬設定 ============ */
.about-main-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center; 
    padding: 40px 5%; /* 這裡統一與首頁間距或需求設定 */
    overflow: hidden; 
    min-height: 0; 
}

.about-container {
    display: flex;
    max-width: 1300px; /* 使用你後來加大的 1300px 版本 */
    width: 100%;
    gap: 60px;
    height: 75vh; 
    max-height: 750px; 
}

/* --- 左側個人檔案 --- */
.profile-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; 
    min-width: 280px;
}
/* --- 左側個人大頭照 --- */
.profile-image-container {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 2px solid #ddd;
    padding: 10px;
    background-color: #fff;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-name-zh {
    font-size: 28px;
    color: #333;
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.profile-name-en {
    font-size: 16px;
    color: #666;
    font-weight: normal;
    margin-bottom: 15px;
}

.profile-title {
    font-size: 14px;
    color: #C98D91;
    font-weight: bold;
    letter-spacing: 1px;
}

/* 自傳文字 */
.autobiography-text p {
    font-size: 15px;
    color: #555;
    line-height: 1.9;
    text-align: left; /* 保留你註解的「靠左對齊」 */
    margin-bottom: 15px;
}

/* --- 右側履歷卡片 --- */
.resume-card {
    flex: 2.5; 
    background-color: #ffffff;
    border-radius: 12px;
    padding: 40px 50px; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    overflow-y: auto; 
    height: 100%; 
}

/* --- 右側卷軸美化 --- */
.resume-card::-webkit-scrollbar { width: 6px; }
.resume-card::-webkit-scrollbar-track { background: transparent; }
.resume-card::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 10px; }
.resume-card::-webkit-scrollbar-thumb:hover { background: #C98D91; }

.resume-section { margin-bottom: 40px; }
.resume-section:last-child { margin-bottom: 0; }

/* --- 右側履歷文字 --- */
.section-title {
    font-size: 18px;
    color: #333;
    border-bottom: 1.5px solid #eaeaea;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-weight: bold;
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.section-title span { font-size: 14px; color: #999; font-weight: normal; }

.resume-list p, .resume-grid p, .specialty-text p {
    font-size: 15px;
    color: #555;
    line-height: 1.8;
    margin-bottom: 8px;
}

.resume-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

.specialty-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

/* --- 軟體技能 Icon 排版 --- */
.software-icons {
    display: grid;
    grid-template-columns: repeat(4, auto); 
    gap: 12px; 
}

/* 純 CSS 繪製的 Icon 樣式 */
.icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    font-size: 14px;
    font-family: Arial, sans-serif;
}
.icon.ps { background: #001e36; border: 2px solid #31a8ff; color: #31a8ff; }
.icon.ai { background: #330000; border: 2px solid #ff9a00; color: #ff9a00; }
.icon.ae { background: #000033; border: 2px solid #9999ff; color: #9999ff; }
.icon.pr { background: #000033; border: 2px solid #ea77ff; color: #ea77ff; }
.icon.html { background: #e34c26; border-radius: 4px; }
.icon.css { background: #264de4; border-radius: 4px; }

/* 針對匯入的圖片 Icon 設定大小 */
.software-icon-img {
    width: 45px; 
    height: 45px; 
    object-fit: contain;
    border-radius: 10px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}


/* ==== 響應式設計 (Responsive Web Design) 針對螢幕寬度 768px 以下 ==== */
@media screen and (max-width: 768px) {    
    /* 1. 頁首調整 */
    header {
        flex-direction: row; /* Logo 和按鈕並排 */
        flex-wrap: wrap;     /* 允許導覽列掉到下一行 */
        padding: 15px 20px;
        /* 移除原本的 gap，避免影響排版 */
    }

    
    /* 在手機版顯示漢堡按鈕 */
    .hamburger {
        display: block; 
    }

    /* 預設隱藏導覽列，並設定成滿版往下長 */
    nav {
        display: none; /* 預設收起 */
        width: 100%;   /* 寬度佔滿 100% 才會掉到 Logo 下面 */
        flex-direction: column;
        align-items: center;
        padding-top: 15px; /* 和上方的距離 */
        gap: 15px;
    }

    /* 當 JS 加上 .active 標籤時，顯示導覽列 */
    nav.active {
        display: flex;
    }

    /* 讓按鈕點擊後變成 X (進階微動畫，看起來更專業) */
    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active span:nth-child(2) {
        opacity: 0; /* 中間的線消失 */
    }
    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    nav a { margin-left: 0; }
    nav a:active {
        color: #C98D91; 
        transform: scale(0.95); 
        transition: 0.1s; 
    }

    /* 2. 首頁核心內容區塊 */
    .main-content-wrapper {
        flex-direction: column; 
        padding: 50px 5% 0;  
        text-align: center; 
        gap: 0; 
        overflow: visible;
    }

    /* 3. 首頁左側文字群組 */
    .text-group-left {
        align-items: center; 
        margin-right: 0;     
        margin-bottom: 0;
        z-index: 30;
    }
    
    .text-design, .text-portfolio { 
        transform: none; 
        font-size: 25vw; /* 使用你最新修改的 25vw */
    }
    
    .text-design:hover, .text-design:active,
    .text-portfolio:hover, .text-portfolio:active {
        transform: scale(1.02); 
        color: rgba(0, 0, 0, 0.9); 
    }
    
    .text-year { 
        font-size: 13px; 
        letter-spacing: 1.5px; 
        margin-top: 15px; 
        padding-left: 0; 
    }

    /* 4. 首頁右側插畫人物 */
    .character-right {
        width: 100%;
        justify-content: center;
        margin-top: 0;
        margin-left: -1vw;
    }
    
    .mini-character-video {
       height: auto;       
       width: 100%;        
       max-width: 450px;   
       max-height: none;
       margin-top: -20px;    
       margin-bottom: 0; 
       mix-blend-mode: multiply;
       clip-path: inset(2px); 
       transform: translateZ(0);
    }

    /* 5. 關於我 (About) 頁面手機版調整 */
    .about-main-wrapper {
        overflow: visible; 
        padding: 40px 5%;
    }
    
    .about-container {
        flex-direction: column; 
        height: auto; 
        max-height: none;
        gap: 40px;
    }
    
    .resume-card {
        overflow-y: visible; /* 手機版垂直溢出處理：解除內部捲動，讓高度隨內容自然撐開 */
        height: auto; 
        padding: 30px 20px; 
    }
    
    .resume-grid {
        grid-template-columns: 1fr; /* 設定欄位：[數量] [寬度單位] */
        gap: 15px 0; 
    }

    .job-date {
        display: block; 
        margin-bottom: 4px; 
        color: #888; 
    }
    
    .desktop-pipe {
        display: none; 
    }
}

/* ============ 作品內頁 (Project Detail) 專屬設定 ============ */
.project-detail-container {
    flex-grow: 1;
    width: 100%;
    min-width: 0;
    max-width: 1000px;
    margin: 60px auto; /* 上下留白 60px，左右置中 */
    padding: 0 5%;
}

/* --- 回目錄按鈕 --- */
.back-btn {
    display: inline-block;
    font-size: 15px;
    color: #888;
    text-decoration: none;
    margin-bottom: 20px;
    transition: color 0.3s ease, transform 0.3s ease;
}
.back-btn:hover {
    color: #C98D91;
    transform: translateX(-5px); /* Hover時微微向左提示返回 */
}

/* 響應式換行專用，預設在電腦版隱藏 */
.mobile-only {
    display: none;
}

/* 標題+內文文字 */
.project-info {
    margin-bottom: 50px;
    text-align: center;
}

.project-info h1 {
    font-size: 32px;
    color: #333;
    margin-bottom: 10px;
}

.project-info p {
    color: #888;
    font-size: 16px;
    line-height: 1.6;
}

.resize-title-wrapper {
    margin-top: 50px; /* 可視需求調整與上方圖片的距離 */
    margin-bottom: 30px; 
    text-align: center; /* 讓文字置中 */
}

.resize-title-wrapper h1 {
    font-size: 32px; 
    color: #333;
    /* 1. 將 h1 下方的距離縮小，你可以根據喜好調整這裡的數值 (例如改為 5px 或 0px) */
    margin-bottom: 5px; 
}

.resize-title-wrapper p {
    color: #888;
    font-size: 16px;
    line-height: 1.6;
    /* 2. 這是最關鍵的一行：強制消除瀏覽器預設給 p 標籤的上方留白 */
    margin-top: 0px; 
}

/* --- 長圖展示區 --- */
.main-kv-section {
    width: 100%;
    margin-bottom: 60px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); /* 給長圖一點陰影質感 */
}

.main-kv-section img {
    width: 100%;
    height: auto;
    display: block; /* 消除圖片下方的預設空白間隙 */
}


.resize-grid {
    column-count: 2; /* 設定成兩排 */
    column-gap: 20px; /* 左右間距 */
    width: 100%;
}

.resize-item {
    break-inside: avoid; 
    margin-bottom: 24px; /* 加大卡片之間的間距 */
    background-color: #fcfcfc; /* 非常淡的灰底，與純白背景做出區隔 */
    padding: 20px; /* 讓圖片跟邊界有呼吸空間 */
    border-radius: 12px; /* 稍微明顯一點的圓角 */
    border: 1px solid #f0f0f0; /* 加一條極細的邊框把形狀收斂起來 */
    box-shadow: 0 4px 15px rgba(0,0,0,0.02); /* 陰影放輕一點，看起來更乾淨 */
}

/* 讓特定圖片可以橫跨所有欄位 */
.resize-item.span-all {
    column-span: all;
}

/* 調整圖片本身，拿掉原本圖片的陰影，讓陰影跟著卡片就好 */
.resize-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px; /* 圖片微圓角即可 */
}

/* ============ 作品項目文字樣式 (配合圖文排版) ============ */

.resize-item .item-text {
    padding: 30px 5px 10px 5px;  /* 讓文字跟圖片拉開一點點距離 (統一為無說明的 30px 間距) */
    text-align: left;
}

/* 沒有說明文字時，自動向下推移 (原本 20px + 新增 10px) */
.item-text.no-desc {
    padding-top: 30px;
}

.item-text .tag {
    font-size: 12px;
    color: #999;
    margin-top: 0;
    margin-bottom: 8px;
    letter-spacing: 0.5px; /* 稍微拉開一點字距更有質感 */
}

.item-text h3 {
    font-size: 20px;
    color: #333;
    margin: 0 0 10px 0;
    font-weight: bold;
}

.item-text .desc {
    font-size: 14px;
    color: #777;
    line-height: 1.6;
    margin: 0;
}

/* 稍微優化一下原本的 img 設定，讓它跟文字搭配更好看 */
.resize-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px; /* 可以稍微增加一點圓角，看你喜好 (原本是4px) */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}


/* --- 針對手機版的微調 --- */
@media screen and (max-width: 768px) {
    .project-detail-container {
        margin: 30px auto;
    }
    
    /* 響應式換行專用，在手機版顯示以達成換行 */
    .mobile-only {
        display: block;
    }
    
    /* 把兩個 h1 寫在一起，讓它們在手機版一起變小 */
    .project-info h1,
    .resize-title-wrapper h1 {
        font-size: 24px;
    }
    
    .resize-grid {
       column-count: 1; /* 手機版螢幕太窄，強制變回單排上下滑動 */
    }
}

/* ============ 圖片放大功能 (Lightbox) ============ */
/* 讓原本的圖片有可以點擊的「放大鏡」游標提示 */
.main-kv-section img, .resize-item img {
    cursor: zoom-in;
    transition: opacity 0.3s ease;
}
.main-kv-section img:hover, .resize-item img:hover {
    opacity: 0.85; /* 滑鼠移過去稍微變暗，暗示可以點擊 */
}

/* 隱藏的彈跳視窗背景 */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    overflow-y: auto;
    /* 把左右 padding 改成 0，讓長圖可以更貼邊 */
    padding: 40px 0;
    box-sizing: border-box; /* 確保 padding 不會把視窗撐破 */
}

/* 當 JS 加上 .show 時，視窗才會顯示 */
.modal.show {
    display: flex; /* 我們再把它改回 flex */
    align-items: flex-start; /* 關鍵1：對齊上方。這樣長圖的「頭」才不會被切掉 */
    justify-content: center; /* 水平置中 */
    animation: fadeIn 0.3s ease; 
}

/* 放大後的圖片設定 */
.modal-content {
    margin: auto; /* 當圖片比螢幕短，它會自動上下推擠達到置中；圖片比螢幕長，它會正常往下滑 */
    display: block;
    width: auto;        /*改為 auto，讓小圖片維持自己原本真實的大小，不被強制拉寬 */
    max-width: 95%; /* 確保大圖片（如主視覺長圖）最大也只會縮放到螢幕的 95%，不會超出畫面 */
    height: auto !important; 
    max-height: 90vh; /* 限制一般圖片最高為螢幕高度的 90% */
    object-fit: contain; /* 確保等比縮放不變形 */
    border-radius: 4px;
    transition: max-height 0.3s ease;
}

/* 長圖專用樣式 (解除高度限制) */
.modal-content.long-image {
    max-height: none;
}

/* 關閉按鈕要改用 fixed，才不會隨著長圖滑走 */
.close-modal {
    position: fixed; 
    top: 20px;
    right: 35px;
    z-index: 1000;
}
.close-modal:hover {
    color: #C98D91; /* 滑過時變成你的專屬玫瑰紅 */
}

/* 簡單的淡入動畫設定 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- 左右切換按鈕 --- */
.prev-btn, .next-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%); /* 確保垂直絕對置中 */
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    padding: 15px;
    user-select: none; /* 防止連點時反白到箭頭文字 */
    z-index: 1000;
    transition: color 0.3s;
}

/* 分別靠左與靠右 */
.prev-btn { left: 20px; }
.next-btn { right: 20px; }

.prev-btn:hover, .next-btn:hover {
    color: #C98D91; /* 滑過時變成你的專屬玫瑰紅 */
}

/* --- 手機版微調：讓箭頭稍微變小、靠邊一點 --- */
@media screen and (max-width: 768px) {
    .prev-btn, .next-btn { 
        font-size: 35px; 
        padding: 10px; 
    }
    .prev-btn { left: 0px; }
    .next-btn { right: 0px; }
}

/* ============ 共用設定 (標題、容器、遮罩動畫) ============ */
.gallery-main-wrapper {
    flex-grow: 1;
    padding: 60px 5%;
    display: flex;
    justify-content: center;
}
.gallery-container {
    max-width: 1200px;
    width: 100%;
}
.gallery-page-title {
    text-align: center;
    color: #333;
    font-size: 28px;
    margin-bottom: 40px;
    letter-spacing: 2px;
}
.gallery-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0; 
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.gallery-overlay span {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
    transform: translateY(15px);
    transition: transform 0.4s ease;
    text-align: center;
    padding: 0 15px;
}

/* --- 手機版：永遠顯示底部漸層與文字標題，避免點擊衝突 --- */
@media screen and (max-width: 768px) {
    .gallery-overlay {
        opacity: 1; /* 永遠顯示 */
        background-color: transparent; /* 取消純色背景 */
        background-image: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 50%); /* 改用底部黑色漸層 */
        align-items: flex-end; /* 內容靠底部對齊 */
        padding-bottom: 20px; /* 留出底部邊距 */
    }
    .gallery-overlay span {
        transform: translateY(0); /* 取消滑動動畫，固定原位 */
        padding: 0 8px; /* 縮小左右內邊距 */
    }
    /* 針對標準長方形網格（單排）的文字大小 */
    .web-item .gallery-overlay span {
        font-size: 16px; 
    }
    /* 針對不規則網格（雙排）的文字大小 */
    .bento-item .gallery-overlay span {
        font-size: 14px; 
    }
}

/* ============ 【網頁視覺】專屬：標準長方形網格 ============ */
.web-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.web-item {
    position: relative;
    display: block;
    border-radius: 16px;
    overflow: hidden;
    background-color: #f5f5f5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    aspect-ratio: 4 / 3; /* 強制橫向長方形 */
}
.web-item img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform 0.4s ease;
}
.web-item:hover img { transform: scale(1.05); }
.web-item:hover .gallery-overlay { opacity: 1; }
.web-item:hover .gallery-overlay span { transform: translateY(0); }

/* --- 【網頁視覺】響應式 --- */
@media screen and (max-width: 992px) {
    .web-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
@media screen and (max-width: 768px) {
    .web-grid { grid-template-columns: 1fr; gap: 20px; } /* 恢復單欄，還原間距 */
}


/* ============ 【品牌形象】專屬：Bento 不規則網格 ============ */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 250px; 
    gap: 20px;
    grid-auto-flow: dense; 
}
.bento-item {
    position: relative;
    display: block;
    border-radius: 24px;
    overflow: hidden;
    background-color: #f5f5f5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}
.bento-item img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform 0.4s ease;
}

/* Bento 尺寸變化 Class */
.bento-item.span-2-col { grid-column: span 2; }
.bento-item.span-2-row { grid-row: span 2; }
.bento-item.span-large { grid-column: span 2; grid-row: span 2; }

.bento-item:hover img { transform: scale(1.05); }
.bento-item:hover .gallery-overlay { opacity: 1; }
.bento-item:hover .gallery-overlay span { transform: translateY(0); }

/* --- 【品牌形象】響應式 --- */
@media screen and (max-width: 992px) {
    .bento-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 200px; }
}
@media screen and (max-width: 768px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; gap: 15px; }
    .bento-item.span-2-col, .bento-item.span-large { grid-column: span 2; }
}
@media screen and (max-width: 480px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 140px; gap: 12px; } /* 維持雙欄，調整高度與間距 */
    .bento-item.span-2-col, .bento-item.span-large { grid-column: span 2; }
}

/* ============ 聯絡我 (Contact) 頁面專屬設定 ============ */
.contact-main-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 5%;
}

.contact-container {
    display: flex;
    max-width: 1100px;
    width: 100%;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.contact-left {
    flex: 1;
    padding: 70px 60px;
    background-color: #fcfcfc;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-title {
    font-family: 'Caveat Brush', cursive;
    font-size: 48px;
    color: #333;
    margin-bottom: 20px;
}

.contact-intro {
    font-size: 16px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 40px;
}

.contact-btn {
    display: inline-block;
    background-color: #363636;
    color: #fff;
    padding: 15px 35px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
    text-align: center;
    width: fit-content;
}

.contact-btn:hover {
    background-color: #C98D91;
    transform: translateY(-2px);
    color: #fff;
}

.contact-right {
    flex: 1;
    padding: 70px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-section { margin-bottom: 35px; }
.contact-section:last-child { margin-bottom: 0; }

.contact-section h3 { font-size: 20px; color: #333; border-bottom: 1.5px solid #eaeaea; padding-bottom: 10px; margin-bottom: 15px; display: flex; align-items: baseline; gap: 10px; font-weight: bold;}
.contact-section h3 span { font-size: 14px; color: #999; font-weight: normal; }
.contact-section p { font-size: 15px; color: #555; line-height: 1.6; margin-bottom: 10px; }
.contact-section ul { list-style-type: none; padding-left: 0; }
.contact-section ul li { font-size: 15px; color: #555; line-height: 1.8; position: relative; padding-left: 20px; margin-bottom: 8px; }
.contact-section ul li::before { content: '•'; color: #C98D91; position: absolute; left: 0; font-size: 18px; line-height: 1.8; }
.reply-time { font-size: 13px !important; color: #C98D91 !important; margin-top: 15px !important; }

@media screen and (max-width: 768px) {
    .contact-container { flex-direction: column; }
    .contact-left { padding: 40px 30px; }
    .contact-right { padding: 40px 30px; background-color: #fff;}
    .contact-title { font-size: 40px; }
}

/* ============ 回到頂部按鈕 (Scroll to Top) ============ */
#scrollToTopBtn {
    position: fixed;
    bottom: 80px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #bfccd6;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(122, 122, 122, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#scrollToTopBtn.show {
    opacity: 1;
    visibility: visible;
}

#scrollToTopBtn:hover {
    background-color: #afaeae;
    transform: translateY(-3px);
}

#scrollToTopBtn svg {
    width: 24px;
    height: 24px;
    display: block;
    stroke-width: 2.5px;
}

/* 手機版微調 */
@media screen and (max-width: 768px) {
    #scrollToTopBtn {
        bottom: 60px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    #scrollToTopBtn svg {
        width: 20px;
        height: 20px;
    }
}