/* ========== Loading 畫面樣式 ========== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #684343 0%, #3b2525 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #ffffff;
    z-index: 10000;
    width: 100%;
}

.loading-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 50px;
    width: 100%;
}

.loading-logo img {
    opacity: 0;
    animation: fadeInUp 1s ease 0.2s forwards; /* 【轉場時間】Logo淡入1秒，延遲0.2秒 */
    border-radius: 10px;
}

.progress-container {
    width: 300px;
    margin: 0 auto;
    transform: translateY(-30px);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fdde78, #85c273);
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: #ffd2d2;
    opacity: 0;
    animation: fadeInUp 1s ease 0.4s forwards; /* 【轉場時間】進度文字淡入1秒，延遲0.4秒 */
}

/* Loading 動畫 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 圓形遮罩轉場動畫 */
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 10001;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.circle-mask {
    position: absolute;
    width: 0;
    height: 0;
    background: radial-gradient(circle, #684343 0%, #3b2525 70%, #2a1a1a 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    left: 50%;
    top: 50%;
    transition: all 2s cubic-bezier(0.25, 0.1, 0.25, 1); /* 【轉場時間】圓形遮罩轉場2秒 */
}

.transition-overlay.expand .circle-mask {
    width: 300vmax;
    height: 300vmax;
    opacity: 0;
    animation: circleExpandFade 2.5s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; /* 【轉場時間】圓形擴展淡出動畫2.5秒 */
}

@keyframes circleExpandFade {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    50% {
        width: 200vmax;
        height: 200vmax;
        opacity: 0.8;
    }
    80% {
        width: 280vmax;
        height: 280vmax;
        opacity: 0.3;
    }
    100% {
        width: 300vmax;
        height: 300vmax;
        opacity: 0;
    }
}

/* 隱藏主要內容 */
.hidden {
    display: none;
}

/* 統一調整所有元素的 box model，讓 padding 不影響總寬度 */
* {
    box-sizing: border-box;
    text-decoration: none;
    list-style: none;
    margin: 0;
    padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* 響應式圖片基礎設定 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 設置網頁整體區塊body效果 */
body {
    background-color: #684343;
    margin: 0 0;
    padding-top: 120px; /* 為固定header留出空間 */
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
    font-family:Arial, sans-serif;
}

/* 主要網頁架構 */
.main {
    margin: 0 auto;
    width: 100%;
    height: 1000px;
    background-color: #684343;  
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;   /* 🔧垂直置中 */
    padding: 0 5%;
    margin: 0 auto;
    width: 100%;
    height: 120px; /* 🔧固定高度，方便圖片與文字對齊 */
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(66, 43, 43, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
}

/* 滾動時縮小的nav樣式 */
header.scrolled {
    height: 60px;
    padding: 0 5%;
}

header .brand { /* 🔧 新增：包裝 logo 與 h1 */
    display: flex;
    align-items: center;
    text-decoration: none;
}

header h1 {
    color: #ffffff;
    font-size: 14pt;
    font-weight: 500;
    line-height: 60px;
    transition: all 0.1s linear;
}

header h1:hover {
    color: #ffd2d2;
}


header .logo {
    height: 54px;
    width: auto;
    margin: 6px 15px;
}

/* 漢堡選單按鈕 */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* 導航選單 */
.nav-menu {
    display: flex;
    align-items: center;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    margin: 20px auto;
}

.nav-menu ul li {
    margin-right: 25px;
}

.nav-menu ul li a {
    color: #ffffff;
    font-size: 10pt;
    transition: all 0.1s linear;
}

.nav-menu ul li a:hover {
    color: #ffd2d2;
}

/* 定義頁首banner章節 */
.home {
    background-image: url(./images/mainbanner.webp);
    background-size: cover;      /* 左右滿版貼邊，上下可切透明像素 */
    background-position: center;
    background-repeat: no-repeat;
    padding-top: 300px;
    padding-bottom: 300px;
    min-height: 800px;          /* 確保有足夠高度顯示圖片 */
}

.home_header {
    text-align: center;
    margin: 0 0;
    color: #ffffff;
    font-size: 30pt;
}

.tagline {
    text-align: center;
    color: #ffffff;
    margin: 16px 0;
}

/* 技能段落 */
.about {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 35px 10%;
    /* background-color: #684343; */
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.h2_title {
    width: 100%;
    color: #ffffff;
    font-size: 12pt;
    font-weight: 400;
    padding: 15px 0;
    border-bottom: 1px solid #8f6e6e;
}

/* 主標題樣式 */
.services_main_title,
.works_main_title,
.about_main_title {
    text-align: center;
    font-size: 24pt;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: none;
    border-bottom: none;
    padding: 40px 0 30px 0;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    width: 100%;
}

/* 手繪波浪底線 */
.services_main_title::after,
.works_main_title::after,
.about_main_title::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 8px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 8"><path d="M2,4 Q37,1 75,4 T150,4 T225,4 T298,4" stroke="%23ff9500" stroke-width="1.5" fill="none" stroke-linecap="round" opacity="0.9"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}

/* 作品描述段落樣式 */
.works_description {
    color: #ffffff;
    font-size: 12pt;
    line-height: 1.8;
    text-align: center;
    padding: 0 10%;
    margin: 30px 0 50px 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* 服務項目容器 */
.service_item {
    display: flex;
    align-items: center;
    min-height: 45vh;
    padding: 40px 10%;
    position: relative;
    overflow: visible;
    box-sizing: border-box;
    margin-bottom: 30px;
}

/* 右側圖片佈局 */
.service_right {
    flex-direction: row;
}

/* 左側圖片佈局 */
.service_left {
    flex-direction: row-reverse;
}

/* 內容區域 */
.service_content_wrapper {
    flex: 1;
    padding: 0 60px;
    z-index: 2;
    position: relative;
}

/* 圖片區域 */
.service_image_wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* 浮動圖片樣式 */
.service_image {
    width: 400px;
    height: 400px;
    object-fit: cover;
    border-radius: 20px;
    position: relative;
    z-index: 1;
}

/* 圖片左右錯開效果 */
.service_item.service_right:nth-of-type(1) .service_image {
    transform: translateX(20px) !important;
}

.service_item.service_left:nth-of-type(1) .service_image {
    transform: translateX(-25px) !important;
}

.service_item.service_right:nth-of-type(2) .service_image {
    transform: translateX(30px) !important;
}

.service_item.service_left:nth-of-type(2) .service_image {
    transform: translateX(-15px) !important;
}

/* 小標題樣式 */
.service_subtitle {
    display: block;
    font-size: 12pt;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    font-weight: 500;
    opacity: 0.8;
}

/* 主標題樣式 - 重新設計 */
.service_title {
    font-size: 20pt;
    margin: 0 0 25px 0;
    letter-spacing: 1.5px;
    line-height: 1.2;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
}

.service_title::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 1px;
    background: #ffffff;
    border-radius: 1px;
}

/* 描述文字樣式 */
.service_description {
    font-size: 12pt;
    line-height: 1.8;
    opacity: 0.9;
    font-weight: 300;
    color: #ffffff;
    max-width: 500px;
}

/* 換行清除浮動 */
.about::after {
    content: "";
    display: block;
    clear: both;
}



.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* ✅ 預設一行三張 */
  gap: 20px;
  margin: 20px 0;
}

.gallery a {
  aspect-ratio: 1 / 1;       /* ✅ 固定正方形 */
  overflow: hidden;
  border-radius: 8px;
  display: block; /* 🔴新增：確保圖片區塊正確佔位 */
}

.gallery a img {
  width: 100%;
  height: 100%;
  object-fit: cover;        /* ✅ 裁切圖片保持填滿 */
  display: block;
  transition: 0.3s ease;
}

/* 燈箱圖片 */

.backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.8);
  cursor: pointer;
  z-index: 998;
}

.lightbox {
  opacity: 0;
  pointer-events: none;         /* ❗ 避免在沒顯示時被點到 */
  transition: opacity 0.3s ease;
  display: flex;
  position: fixed;
  inset: 0;
  justify-content: center;
  align-items: center;
  overflow: auto; /* 🔴 加這行，讓超大圖片可以滾動 */
  padding: 20px;  /* 🔴 防止圖片貼邊，增加視覺舒適 */
}

.lightbox:target {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: calc(100vw - 80px);  /* 80px = 2 * 20px padding + some margin */
  max-height: calc(100vh - 80px);
  border: 4px solid white;
  border-radius: 6px;
  pointer-events: none;  /* ✅ 點圖片時不會觸發關閉 */
  z-index: 999;              /* ✅ 加這行圖片就會蓋在遮罩上 */
  position: relative;        /* ✅ 必須搭配 position 才會套用 z-index */
}

.lightbox .close {
  position: fixed;
  top: 20px;
  right: 30px;
  width: 30px;
  height: 30px;
  text-decoration: none;
  z-index: 1001;
}

.lightbox-content {
  position: relative;
  z-index: 999;
  text-align: center;
  display: block;
}

.lightbox .close::before, .lightbox .close::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 0;
  width: 30px;
  height: 2px;
  background-color: white;
}

.lightbox .close::before {
  transform: rotate(45deg);
}

.lightbox .close::after {
  transform: rotate(-45deg);
}

.lightbox:target {
  opacity: 1;
  pointer-events: auto;         /* ✅ 顯示時才能互動 */
}

.contact_flex {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 80px; /* 🔧 新增：調整間距 */
    align-items: center; /* 🔧 改為垂直置中對齊 */
    width: 100%;
}

.contact_flex img {
  border-radius: 8px;
}

.contact_content {
  width: 100%;
  max-width: 800px;
  color: #ffffff;
}

.footer {
  width: 100%;
  background-color: #3b2525;
  padding: 20px 0;
  margin-top: 35px;
}

.link_title {
  color: #ffffff;
  font-size: 12pt;
  font-weight: 500;
  margin-bottom: 10px;
}

.footer_2column {
  display: flex;
  width: 90%;
  margin: 30px auto;
  justify-content: space-evenly;
}

.footer_link {
  display: flex;
  width: 25%;
}

.footer_link .link_button {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 10px 20px;
  margin: 6px auto;
  border-radius: 100px;
  font-size: 10pt; /* 參照nav桌機版字級 */
  transition: all 0.1s linear;
}

.footer_link .link_button:hover {
  background-color: #ffd2d2;
  color: #3b2525;
}

.footer_copyright {
  color: #ffffff;
  text-align: center;
  font-size: 10pt;
  margin: 20px auto;
}

/* ========== 響應式設計 - 平板裝置 ========== */
@media screen and (max-width: 1024px) {
  /* 導航調整 - 顯示漢堡選單 */
  header {
    width: 95%;
    padding: 0 15px;
  }
  
  .hamburger {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background-color: rgba(104, 67, 67, 0.98);
    backdrop-filter: blur(15px);
    transition: right 0.3s ease;
    z-index: 999;
    padding-top: 100px;
  }
  
  .nav-menu.active {
    right: 0;
  }
  
  .nav-menu ul {
    flex-direction: column;
    margin: 0;
    padding: 20px;
    height: 100%;
  }
  
  .nav-menu ul li {
    margin: 0 0 20px 0;
    width: 100%;
  }
  
  .nav-menu ul li a {
    display: block;
    padding: 15px 20px;
    font-size: 14pt;
    text-align: center;
    transition: all 0.3s ease;
  }
  
  .nav-menu ul li a:hover {
    background-color: #ffd2d2;
    color: #3b2525;
    transform: translateX(-5px);
  }
  
  /* 首頁banner調整 */
  .home {
    padding-top: 200px;
    padding-bottom: 200px;
  }
  
  .home_header {
    font-size: 24pt;
  }
  

  
  /* 作品展示調整 */
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  /* 聯絡區塊調整 */
  .contact_flex {
    gap: 40px;
    flex-direction: row; /* 平板維持左右並置 */
  }
  
  .contact_flex img {
     max-width: 100%;
     height: auto;
   }
 }

/* ========== 響應式設計 - 平板裝置 (768px) ========== */
@media screen and (max-width: 768px) {
  .home_header {
    font-size: 36pt;
  }
  
  .tagline {
    font-size: 16pt;
  }
  
  .h2_title {
    font-size: 28pt;
    letter-spacing: 2px;
  }
  
  .service_item {
     flex-direction: column !important;
     padding: 40px 10%;
     text-align: center;
     min-height: 45vh;
   }
   
   .service_content_wrapper {
     padding: 0 20px 30px 20px;
     order: 2;
   }
   
   .service_image_wrapper {
     order: 1;
     margin-bottom: 25px;
   }
   
   .service_image {
     width: 300px;
     height: 300px;
   }
   
   .service_title {
     font-size: 18pt;
   }
   
   .service_description {
     font-size: 10pt;
     max-width: 100%;
   }
}

/* ========== 響應式設計 - 手機裝置 ========== */
@media screen and (max-width: 767px) {
  /* 導航調整 - 手機版漢堡選單 */
  header {
    width: 100%;
    padding: 0 10px;
  }
  
  .hamburger {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background-color: rgba(104, 67, 67, 0.98);
    backdrop-filter: blur(15px);
    transition: right 0.3s ease;
    z-index: 999;
    padding-top: 100px;
  }
  
  .nav-menu.active {
    right: 0;
  }
  
  .nav-menu ul {
    flex-direction: column;
    margin: 0;
    padding: 15px;
    height: 100%;
  }
  
  .nav-menu ul li {
    margin: 0 0 15px 0;
    width: 100%;
  }
  
  .nav-menu ul li a {
    display: block;
    padding: 12px 15px;
    font-size: 12pt;
    text-align: center;
    transition: all 0.3s ease;
  }
  
  .nav-menu ul li a:hover {
    background-color: #ffd2d2;
    color: #3b2525;
    transform: translateX(-5px);
  }
  
  /* 首頁banner調整 */
  .home {
    padding-top: 120px;
    padding-bottom: 120px;
    margin: 0 10px;
  }
  
  .home_header {
    font-size: 18pt;
    padding: 0 20px;
  }
  
  .tagline {
    font-size: 12pt;
    padding: 0 20px;
  }
  
  /* 服務項目調整 */
  .about {
    width: 100%;
    padding: 20px 10%;
  }
  
  .service_item {
         flex-direction: column !important;
         padding: 30px 10%;
         text-align: center;
         min-height: 40vh;
     }
     
     .service_content_wrapper {
         padding: 0 15px 20px 15px;
         order: 2;
     }
     
     .service_image_wrapper {
         order: 1;
         margin-bottom: 20px;
     }
     
     .service_image {
         width: 250px;
         height: 250px;
     }
     
     .service_subtitle {
         font-size: 10pt;
     }
     
     .service_title {
         font-size: 16pt;
     }
     
     .service_description {
         font-size: 8pt;
         max-width: 100%;
     }
  

  

  
  /* 作品展示調整 */
  .gallery {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  /* 聯絡區塊調整 */
  .contact_flex {
    flex-direction: column;
    gap: 20px;
    text-align: left; /* 手機版靠左對齊 */
    align-items: flex-start; /* 整體靠左對齊 */
  }
  
  .contact_flex img {
    max-width: 100%;
    height: auto;
    align-self: flex-start; /* 圖片也靠左對齊 */
  }
  
  .contact_content {
    padding: 0 10%;
    text-align: left; /* 文字內容靠左對齊 */
  }
  
  .contact_info {
    font-size: 11pt;
    line-height: 1.6;
  }
  
  /* 頁尾調整 */
  .footer {
    padding: 20px 10%; /* 預留左右間距 */
  }
  
  .footer_2column {
    flex-direction: column;
    width: 100%;
    text-align: left; /* 改為靠左對齊 */
  }
  
  .footer_link {
    width: 100%;
    justify-content: flex-start; /* 按鈕靠左對齊 */
    margin-bottom: 20px;
  }
  
  .footer_link ul {
    text-align: left; /* 改為靠左對齊 */
  }
  
  .footer_link .link_button {
    margin: 5px 8px;
    padding: 12px 20px; /* 增大padding讓按鈕更好點擊 */
    font-size: 12pt; /* 增大字級方便閱讀和點擊 */
  }
  
  /* 燈箱調整 */
  .lightbox img {
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
  }
  
  .lightbox .close {
    top: 10px;
    right: 15px;
  }
}

/* 手機 */
@media (max-width: 480px) {
    .home_header {
        font-size: 28pt;
    }
    
    .tagline {
        font-size: 14pt;
    }
    
    .h2_title {
        font-size: 24pt;
        letter-spacing: 1px;
        padding: 20px 0;
    }
}






