.image-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* RWD 核心 */
  gap: 10px;

}

.image-grid .pic {
  aspect-ratio: 2112 / 3072; /* 根據你的圖比例設定 */
  overflow: hidden;
}

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

@media (max-width: 768px) {
  .image-grid {
    grid-template-columns: repeat(2, 1fr); /* 平板：2+2 格 */
  }
}

@media (max-width: 480px) {
  .image-grid {
    grid-template-columns: 1fr; /* 手機：1 格 */
  }
}
/* 讓畫布浮動在左邊，段落自動繞排 */
.jagged-box{
  float: left;                       /* 只有這塊參與文字繞排 */
  width: 260px;                      /* 想要的版面尺寸 */
  aspect-ratio: 1/1;
  clip-path: var(--zigzag);          /* 同前：鋸齒邊、polygon() 或 url(svg) */
  shape-outside: var(--zigzag);
  margin: 0 1.5rem 1rem 0;           /* 文字與圖片間距 */
  position: relative;                /* 讓 canvas 能 absolute 定位 */
  overflow: hidden;                  /* 把多餘畫布切掉，避免壓到旁邊 */
}

/* 2. 內層 canvas 完全貼滿容器，**不參與排版** ---------- */
.jagged-box > canvas{
  position: absolute;
  inset: 0;                          /* top:0 right:0 bottom:0 left:0 */
  width: 100%;
  height: 100%;
  display: block;                    /* 消除行內縫隙 */
  pointer-events: none;              /* 如果你不需要接滑鼠事件 */
}

.content{
  font-family:sans-serif;
  font-size:15px;
  line-height:1.6;
  text-align:justify;
}
/* 背景圖形 */
.bg-shape{
  width: 95vw;      /* 想多大就調 */
  height: 80vh;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  z-index: 0;       /* 最底層 */
  pointer-events: none;
}
/* -------------------- 字體 & 動畫 -------------------- */

@font-face {
    font-family: 'LXGW WenKai Light';
    src: url('/fonts/LXGWWenKai-Light.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'LXGW WenKai Regular';
    src: url('/fonts/LXGWWenKai-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* 打字機動畫 */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* 游標閃爍效果 */
@keyframes blink {
    50% { border-color: transparent; }
}

@keyframes blinkCursor {
    from { border-color: white; }
    to { border-color: transparent; }
}

/* -------------------- 全局變數 -------------------- */
:root {
    --scroll-y: 0px;
    --parallax-factor: -0.3; /* 設定視差速度 */
}

/* -------------------- 全局樣式 -------------------- */
html, body {
    overflow-x: hidden; /* 隱藏 X 軸滾動 */
    width: 100%; /* 確保寬度不超過視口 */
    margin: 0;
    padding: 0;
    font-family: 'LXGW WenKai Regular', sans-serif;
    background:#ddd;
    width: 100%;
}
* {
    box-sizing: border-box; /* 確保寬度不會被 padding/border 增加 */
}
p{
  margin: 5px;
}
h1{
  margin: 0;
}
h2{
  font-family: 'LXGW WenKai Light', sans-serif;
  font-weight: normal;
  font-style: normal;
  text-align: center;
}
.d-flex{
    display: flex;
    justify-content: center;
    white-space: nowrap;
    height:auto;
    margin: 0 auto;
}
.image{
    display: inline-block;
    min-height: 300px;
    min-width: 20%;
    padding: 3em;
    margin: 0.5em;
    display: inline-block;
    position: relative;

}
/* -------------------- 主要容器 -------------------- */

header {
    font-family: 'LXGW WenKai Light', sans-serif;
    color: white;
    background-color: black;
}

/* 頁首打字機效果 */
.header-typewriter {
    position: fixed;
    width: 100%;
    max-height: 36px;
    background-color: black;
    color: white;
    font-size: 20px;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    z-index: 500;
    padding: 0 70px;
    margin-top: 0;
    display: inline-block;
    transform: scaleX(1);
}

#typewriter-text {
    font-family: 'LXGW WenKai Light', sans-serif;
    font-weight: 100;
    overflow: hidden;
    display: inline-block;
    white-space: nowrap;
    border-right: 2px solid white;
    padding-right: 5px;
    animation: blinkCursor 0.6s infinite alternate;
}

/* -------------------- 視差滾動區 -------------------- */

.perspective-container {
    position: relative;
    width: 100％;
    height: 350px;
    overflow: hidden;
}

/* 視差背景 */
.parallax {
    width: 100%;
    height: 350px;
    display: block;
    color: black;

    opacity: 50%;
    overflow: hidden;
}

.parallax-bg  {
    position: relative;
    top: -500px;
    width: 100%;
    height: auto;
    background-repeat: repeat; /* 讓圖片在 X 軸 & Y 軸 都重複 */
    background-size: contain;
    transform: translateY(calc(var(--scroll-y) * var(--parallax-factor)));
    transition: transform 0.1s ease-out;
    z-index: 1;
}

/* 視差內容 */
.parallax-content {
    top: 70px;
    position: absolute;
    width: 100%;
    padding: 20px;
    color: white;
    text-align: center;
    z-index: 5;
    margin: 0 auto;
}

/* -------------------- 動畫文字 -------------------- */

.animated-text {
    text-decoration: none;
    color: white;
    font-size: 70px;
    font-family: 'LXGW WenKai Regular', sans-serif;
    font-weight: 100;
    overflow: hidden;
    display: inline-block;
    white-space: nowrap;
    animation: typing 3s steps(30) forwards;
    margin: -20px auto;
}

.animated-text:hover {
    cursor: pointer;
    color: #DADADA;
}

/* -------------------- 漢堡選單按鈕 -------------------- */

.btncontainer {

}

/* 漢堡按鈕 */
.menu-btn {
    position: fixed;
    top: -7px;
    left: 10px;
    background: transparent;
    border: none;
    font-size: 36px;
    color: white;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.3s ease, color 0.3s ease;
}

/* 按鈕點擊時旋轉 */
.menu-btn.active {
    transform: rotate(90deg);
    color: #f0a500;
}

/* -------------------- 導覽列 -------------------- */

nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 35px;
}

nav ul li a {
    text-decoration: none;
    color: #BBBBBB;
    font-size: 1.2rem;
    transition: opacity 0.3s ease;
}

nav ul li a:hover {
    opacity: 50%;
}


/*--------------------------- */
.content{
    max-width: 90%;
    margin: 20px auto;
    padding: 10px;
}
.text1{
    font-family: 'LXGW WenKai Regular', sans-serif;
    text-align: center;
    font-size: 16px;
    color: black;
    display: block;
    transition: 0.1s;
    margin:10px 0;
}


/* 設置滾動區塊容器 */
.scroll-container {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;

}

/* 設置滾動內容區塊 */
.scroll-content {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    white-space: nowrap;
    max-width: 1000px;
    padding: 0px;
    cursor: grab;
    margin:0 auto;
    user-select: none;
    height: 100%;
}

/* 拖動時的鼠標效果 */
.scroll-content:active {
    cursor: grabbing;
}

/* 隱藏滾動條（適用於 Chrome、Edge、Safari） */
.scroll-content::-webkit-scrollbar {
    display: none;
}

/* 隱藏滾動條（適用於 Firefox） */
.scroll-content {
    scrollbar-width: none;
}

/* 隱藏滾動條（適用於 IE 和 Edge） */
.scroll-content {
    -ms-overflow-style: none;
}

/* 設置滾動項目 */
.item {
    flex: 0 0 auto;
    width: 200px;
    background: none;
    text-align: left;
    display: flex;
    flex-direction: column;
    font-size: 18px;
    margin: 20px;
    user-select: none;
}

/* 強制圖片區塊為正方形 */
.item_img {
    width: 100%;
    padding-top: 100%; /* ✅ 正方形比例 */
    position: relative;
    overflow: hidden;
}

.item_img img {
    position: absolute; /* ✅ 完全蓋住容器 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    box-shadow: 0 8px 10px rgba(0, 0, 0, 0.3);
}
.item_p{
  padding: 10px 5px;
  font-size: 16px;
  color: #333;
}
.item p {
  height: auto;; /* 下半部分是文字 */
  margin:0px;
  padding:0;
}
.item_name{
  margin: 10px 0;
}
.item_tag{
  margin-bottom:5px;
}

/* 滾動按鈕 */
.scroll-container button {
    background-color: transparent;
    color: black;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 5px;
}

/* 滑鼠懸停按鈕 */
.scroll-container button:hover {
  color: linear-gradient(90deg, #005bea, #00c6fb);
  transform: scale(1.3);
}



.text2{

}


.containerhead{
    width:100%;
    height:auto;
    background-color:black;
}

.container {
    max-width: 100%;
    border-radius: 0px;
    background-color: #EAEAEA;
}
.containerfoot {
    border-radius: 0px;
    font-size: 13px;
}
.container2 {
    min-height: 1px;
    width: 100%;
    height: 200px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    background-color: black;
}



.jumbotron {
    position: relative;
    width: 100%;
    height: auto;
    background-repeat: no-repeat;
    no-repeat center;
    object-fit: cover;
    top: -200px;
    transform: translateY(calc(var(--scroll-y) * var(--parallax-factor)));
    transition: transform 0.1s ease-out;
}

.jumbotron img{
    width: 100%;
    height: auto;
}




/* sidebar */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
}


/* 當側邊欄打開時，顯示遮罩層 */
.sidebar.open {
    width: 250px;
}

/* 側邊欄基礎樣式 */
.sidebar {
    height: 100%;
    width: 0;
    position: fixed;
    top: 0;
    left: 0;
    background-color: white;
    overflow-x: hidden;
    transition: 0.4s;
    padding-top: 60px;
    z-index: 1002;
}

/* 側邊欄連結樣式 */
.sidebar a {
    padding: 5px 20px;
    text-decoration: none;
    font-family: 'LXGW WenKai Regular', sans-serif;
    text-align: justify;
    font-size: 18px;
    font-weight: 300;
    color: black;
    display: block;
    transition: 0.1s;
    text-align: left;
}

/* 滑鼠懸停時變色 */
.sidebar a:hover {
    cursor: pointer;
    color: linear-gradient(90deg, #005bea, #00c6fb);
    transform: scale(0.95);
}

/* 確保 .dropdown 是相對定位 */
.dropdown {
    position: relative;
    display: block;
}

/* 設定按鈕 */
.dropdown-btn {
    padding: 5px 20px;
    background: transparent;
    border: none;
    text-decoration: none;
    font-family: 'LXGW WenKai Regular', sans-serif;
    text-align: justify;
    font-size: 18px;
    font-weight: 300;
    color: black;
    display: block;
    transition: 0.1s;
    text-align: left;
}
.dropdown-btn:hover{
    cursor: pointer;
    color: linear-gradient(90deg, #005bea, #00c6fb);
    transform: scale(0.95);
}
/* 設定選單初始狀態（隱藏） */
.dropdown-content {
    margin: auto 40px auto 30px;
    display: none;
    position: static;
    background-color: transparent;
    min-width: 150px;
    overflow: hidden;
    transition: height 0.3s ease-out;
}

/* 選單內的選項 */
.dropdown-content a {
    display: block;
    padding: 10px;
    color: black;
    text-decoration: none;
}

/* 滑鼠移動到選項時的效果 */
.dropdown-content a:hover {
    margin-left: 10px;
    cursor: pointer;
    color: linear-gradient(90deg, #005bea, #00c6fb);
    transform: scale(0.95);
}
/* 初始向下 */
.arrow {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid white;
    transition: transform 0.3s ease;
}
/* 旋轉 180 度，變成向上箭頭 */
.dropdown.active .arrow {
    transform: rotate(180deg);
}
.dropdown.active .dropdown-content {
    display: block; /* 展開時顯示 */
}



.overlay.open {
    display: block;
}

/* 調整側欄內的 X 按鈕 */
.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 40px;
    color: gray;
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
    transition: transform 0.2s;
}

/* X 按鈕 hover 效果 */
.close-btn:hover {
    transform: scale(1.2);
    color: #EFEFEF;
}


.menu-btn:hover {
    opacity: 50%;
}

.section {
    height: 300px;
    width: 100%;
    display: flex;
    gap: 10px;
    white-space: nowrap;
    margin:20px 0px;
}
.tilt-box {
    width: 500px;
    height: 300px;
    justify-content: center;
    margin: 0 auto;
    background: url('https://res.cloudinary.com/dyjvqds92/image/upload/v1739414629/index_main_bho0av.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) ;
}
.parallaxblock{
    min-height: 500px;
}
.parallaxtext{
    min-height: 500px;
}

footer {
    max-width: 90%;
    margin: 20px auto;
    padding: 10px;
}
