@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400..900&family=Lora:ital,wght@0,400..700;1,400..700&family=Noto+Sans+JP:wght@100..900&family=Noto+Serif+TC:wght@200..900&family=Noto+Serif:ital,wght@0,100..900;1,100..900&family=Raleway:ital,wght@0,100..900;1,100..900&display=swap');
/*.lora-<uniquifier> {
  font-family: "Lora", serif;
  font-optical-sizing: auto;
  font-weight: <weight>;
  font-style: normal;
}*/

/*
Bickham Script Pro 3 Regular
font-family: "bickham-script-pro-3", sans-serif;
font-weight: 400;
font-style: normal;
Bickham Script Pro 3 Bold
font-family: "bickham-script-pro-3", sans-serif;
font-weight: 700;
font-style: normal;
*/
.Bickham-Script-Pro-3-Regular {
  font-family: "bickham-script-pro-3", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.lora-Regular {
  font-family: "Lora", serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

.lora-Bold {
  font-family: "Lora", serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-style: normal;
}

body,
html {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  position: relative;
  width: 100%;
  height: auto;
  min-height: 100%;
  margin: 0;
  padding: 0;
  /*     scroll-behavior: smooth; */
  --vw-base: calc(100vw / 1920);
  background-color: #f3eee7;
  /*     cursor: none; */
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  padding: 0;
}

a:link,
a:visited,
a:hover,
a:active {
  text-decoration: none;
}

button,
input,
textarea,
select,
option {
  margin: 0;
  padding: 0;
  -webkit-appearance: none;
  -webkit-border-radius: 0px;
  border-radius: 0;
  -moz-appearance: none;
  appearance: none;
  outline: none;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

video {
  object-fit: cover;
  width: 100%;
  height: 100%;
  position: relative;
  display: block;
}


.container {
  width: 100%;
  height: auto;
  position: relative;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease;
}

.no-scroll {
  overflow: hidden;
  /* 禁止滚动条 */
  touch-action: none;
  /* 禁止移动端触摸滚动 */
  position: fixed;
  /* 防止页面跳动 */
  width: 100%;
  height: 100vh;
}

.opacity {
  opacity: 1;
  position: relative;
  visibility: visible;
}

/*影片區*/
.main1 {
  width: 100%;
  height: calc(950 * var(--vw-base));
  position: relative;
  background-color: #f3eee7;
  /* 確保超出容器的部分被隱藏，達成裁切感 */
  overflow: hidden;
}

/* 這裡維持你的動畫觸發 */
.main1.active {
  animation: m1-bg-motion 1.5s forwards;
  /* 移除 alternate 避免來回彈跳，除非你原本就需要 */
  animation-delay: 0s;
  animation-timing-function: ease-out;
}

.m1-bg {
  width: 100%;
  /* 初始高度與容器一致 */
  height: calc(950 * var(--vw-base));
  position: relative;
  margin: 0 auto;
  z-index: 98;
  overflow: hidden;
  /* 重要：裁切關鍵 */
}

/* 動畫改為縮減容器高度 */
@keyframes m1-bg-motion {
  0% {
    height: calc(950 * var(--vw-base));
  }

  100% {
    height: calc(760 * var(--vw-base));
  }
}

.m1-bg img {
  object-fit: cover;
  width: 100%;
  /* 關鍵：高度固定為原始高度，不要隨父層縮放 */
  height: calc(950 * var(--vw-base));
  position: absolute;
  top: 0;
  left: 0;
  display: block;
}


.m1-txt {
  width: 100%;
  height: calc(520*var(--vw-base));
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 105;
  overflow: hidden;
}

.m1-t1 {
  color: rgba(255, 255, 255, 0.2);
  font-family: "Lora", serif;
  font-weight: 600;
  font-size: calc(48 * var(--vw-base));
  line-height: 3vw;
  letter-spacing: 0em;
  transform: scaleX(0.95);
  transform-origin: left center;
  writing-mode: vertical-rl;
  display: block;
  position: absolute;
  left: 12.6vw;
  top: 0.4vw;
  width: calc(50 * var(--vw-base));
  height: calc(260 * var(--vw-base));
  overflow: hidden;
  opacity: 0;
}

.m1-t2 {
  color: rgba(255, 255, 255, 0.6);
  line-height: 3vw;
  font-size: calc(22 * var(--vw-base));
  font-family: "Noto Serif TC", sans-serif;
  letter-spacing: 0.05em;
  font-weight: 600;
  transform: scaleX(0.95);
  transform-origin: left center;
  display: block;
  position: absolute;
  left: 12.75vw;
  top: 13.3vw;
  width: calc(120 * var(--vw-base));
  height: calc(50 * var(--vw-base));
  opacity: 0;
  overflow: hidden;
}

.m1-t1.active {
  animation: m1-t1-ani 1.5s ease;
  animation-delay: 1s;
  animation-fill-mode: forwards;
}

.m1-t2.active {
  animation: m1-t2-ani 1.5s ease;
  animation-delay: 1s;
  animation-fill-mode: forwards;
}

@keyframes m1-t1-ani {
  0% {
    left: 11.65vw;
    transform: scaleX(0.95);
    opacity: 0;
  }

  100% {
    left: 12.65vw;
    transform: scaleX(0.95);
    opacity: 1;
  }
}

@keyframes m1-t2-ani {
  0% {
    left: 13.75vw;
    transform: scaleX(0.95);
    opacity: 0;
  }

  100% {
    left: 12.75vw;
    transform: scaleX(0.95);
    opacity: 1;
  }
}

.m1-line {
  width: 1px;
  height: calc(0*var(--vw-base));
  background-color: rgba(255, 255, 255, .35);
  position: absolute;
  left: 12.7vw;
  top: 0.4vw;
  overflow: hidden;
  /* 🔴 很重要，避免 after 超出 */
}

.m1-line.active {
  animation: m1-line 1.5s linear;
  animation-delay: 2s;
  animation-fill-mode: forwards;
}

@keyframes m1-line {
  0% {
    height: calc(0*var(--vw-base));
  }

  100% {
    height: calc(665*var(--vw-base));
  }
}

.m1-line::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 1);

  transform-origin: top;
  transform: scaleY(0);
}

@keyframes drawLine {
  0% {
    transform: scaleY(0);
    opacity: 1;
  }

  70% {
    transform: scaleY(1);
    opacity: 1;
  }

  100% {
    transform: scaleY(1);
    opacity: 0;
    /* 畫完淡出再重來 */
  }
}

.m1-line.active::after {
  animation: drawLine 3s ease-in-out infinite;
  animation-delay: 3s;

}




/* 只負責視覺比例 */
.m4-scale {
  display: inline-block;
  transform: scaleX(0.95);
  transform-origin: left center;
}


/* =========================================
   MAIN2
========================================= */
#main2 {
  position: relative;
  width: 100%;
  /* 移除固定 height，讓 GSAP ScrollTrigger 撐開高度 */
  min-height: 100vh;
  overflow: visible !important;
  /* 必須為 visible 否則 Pin 之後的內容會消失 */
}

.m2-line1 {
  width: 1px;
  height: calc(0*var(--vw-base));
  background-color: rgba(137, 126, 121, 0.5);
  position: absolute;
  left: 12.7vw;
  top: 0vw;
  overflow: hidden;
  /* 🔴 很重要，避免 after 超出 */
  z-index: 10;
}

.m2-line1.active {
  animation: m2-1-line 1s linear;
  animation-delay: 0s;
  animation-fill-mode: forwards;
}

@keyframes m2-1-line {
  0% {
    height: 0;
  }

  100% {
    height: 300vh;
  }
}

.m2-line2 {
  width: 1px;
  height: calc(0*var(--vw-base));
  background-color: rgba(137, 126, 121, 0.5);
  position: absolute;
  left: 69vw;
  bottom: 0vw;
  overflow: hidden;
  /* 🔴 很重要，避免 after 超出 */
  z-index: 10;
}

.m2-line2.active {
  animation: m2-2-line 1s linear;
  animation-delay: 0.5s;
  animation-fill-mode: forwards;
}

@keyframes m2-2-line {
  0% {
    height: 0;
  }

  100% {
    height: 300vh;
  }
}

.m2-line3 {
  width: 1px;
  height: calc(0*var(--vw-base));
  background-color: rgba(137, 126, 121, 0.5);
  position: absolute;
  left: 86.5vw;
  top: 0vw;
  overflow: hidden;
  /* 🔴 很重要，避免 after 超出 */
  z-index: 5;
}

.m2-line3.active {
  animation: m2-3-line 1s linear;
  animation-delay: 1s;
  animation-fill-mode: forwards;
}

@keyframes m2-3-line {
  0% {
    height: 0;
  }

  100% {
    /*height: calc(1170*var(--vw-base));*/
    height: 300vh;
  }
}


.m2-txt {
  position: absolute;
  top: 20vw;
  left: 35vw;
  width: 70vw;
  z-index: 10;
}

.m2-txt-title {
  width: calc(700*var(--vw-base));
  overflow: hidden;
  color: #756b66;
  font-size: calc(22 * var(--vw-base));
  line-height: calc(30 * var(--vw-base));
  font-weight: 700;
  font-family: 'Noto Serif TC', sans-serif;
  letter-spacing: 0.1em;
  transform: scaleX(0.95);
  transform-origin: left center;
  display: block;
}

.m2-txt-stitle {
  width: calc(700*var(--vw-base));
  overflow: hidden;
  color: #756b66;
  font-size: calc(18 * var(--vw-base));
  line-height: calc(30 * var(--vw-base));
  font-weight: 700;
  font-family: 'Noto Serif TC', sans-serif;
  letter-spacing: 0.1em;
  margin-bottom: 1vw;
}

.m2-txt-cent {
  width: calc(500*var(--vw-base));
  overflow: hidden;
  color: #756b66;
  font-size: calc(16 * var(--vw-base));
  line-height: calc(33 * var(--vw-base));
  font-family: 'Noto Serif TC', sans-serif;
  letter-spacing: 0.05em;
  text-align: justify;
  text-align-last: left;
  text-justify: inter-ideograph;
}



#main2 {
  position: relative;
  width: 100%;
  min-height: 100vh;
  /* 確保有基礎高度 */
  overflow: visible !important;
  /* 🔴 絕對不能是 hidden */
}

.m2-pic-inner {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: visible;
  /* 🔴 確保文字滑出時不會被切掉 */
}

/* 讓容器可以讓文字自由穿梭 */
.m2-pic-1,
.m2-pic-2,
.m2-pic-3,
.m2-pic-4,
.m2-pic-5 {
  position: absolute;
  width: auto;
  height: auto;
  overflow: visible !important;
  z-index: 10;
}

/* 將你原本給容器的寬高設定在 img 上 */
.m2-pic-inner img {
  display: block;
  width: calc(603 * var(--vw-base));
  height: calc(747 * var(--vw-base));
  object-fit: cover;
}

/* 文字設定 */
.m2-txt-in {
  position: absolute;
  z-index: 1000;
  white-space: nowrap;
  pointer-events: none;
  /* 初始隱藏：移除 visibility: hidden，改用 GSAP 初始設定 */
  opacity: 0;
  display: block;
}

/* 確保圖片容器不會裁切到溢出的文字 */
.m2-pic-1,
.m2-pic-2,
.m2-pic-3,
.m2-pic-4,
.m2-pic-5 {
  overflow: visible !important;
}

.m2-pic-inner>div {
  cursor: pointer;
  /* 讓使用者知道可以互動 */
  transition: z-index 0s;
  /* 避免 z-index 延遲導致重疊錯誤 */
}

.m2-txt-in .m2-txt-title {
  width: calc(350*var(--vw-base));
  overflow: hidden;
  color: #756b66;
  font-size: calc(22 * var(--vw-base));
  line-height: calc(40 * var(--vw-base));
  font-weight: 700;
  font-family: 'Noto Serif TC', sans-serif;
  letter-spacing: 0.1em;
}

.m2-txt-in .m2-txt-cent {
  width: calc(350*var(--vw-base));
  overflow: hidden;
  color: #756b66;
  font-size: calc(16 * var(--vw-base));
  line-height: calc(25 * var(--vw-base));
  font-family: 'Noto Serif TC', sans-serif;
  letter-spacing: 0.05em;
  text-align: justify;
  text-align-last: left;
  text-justify: inter-ideograph;
}


/* 確保 main2 容器不會因為圖片位移而撐開捲軸 */
#main2 {
  overflow: hidden !important;
  position: relative;
  width: 100%;
  /* 如果你的 main2 是全螢幕高度 */
  height: 100vh;
}

/* 額外保險：防止 GSAP pin 產生的預留空間導致右側白邊 */
.pin-spacer {
  overflow: hidden !important;
}

/* 在你的 CSS 檔案中加入 */
.m2-pic-1,
.m2-pic-2,
.m2-pic-3,
.m2-pic-4,
.m2-pic-5,
#main2>.m2-txt,
.m2-txt-in {
  opacity: 0;
}

.m2-pic-inner .m2-pic-1 img {
  width: calc(603 * var(--vw-base));
  height: calc(690 * var(--vw-base));
  object-position: top center;
}



/*跑馬燈*/
.marquee-wrapper {
  width: 100%;
  /* 這是容器高度：360 */
  height: calc(360 * var(--vw-base));
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  border-top: 1px solid rgba(137, 126, 121, 0.5);
  border-bottom: 1px solid rgba(137, 126, 121, 0.5);

  /* 強制讓內部的 marquee-content 垂直置中 */
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start;
}

/* 跑馬燈內容軌道 */
.marquee-content {
  display: flex;
  align-items: center;
  /* 確保內容物中線對齊 */
  width: max-content;
  animation: marquee-scrolling 40s linear infinite;
  padding-bottom: 1vw;
}


/* 滑入時暫停動畫 */
.marquee-wrapper:hover .marquee-content {
  animation-play-state: paused;
}

@keyframes marquee-scrolling {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* 每一組 (文字+圖片) 的容器 */
.marquee-content-box {
  display: flex;
  flex-direction: column;
  /* 讓文字在上，圖片在下 */
  align-items: flex-start;
  /* 靠左對齊，若要置中可改 center */
  margin-right: 0.5vw;
  /* 每一組之間的間距 */
  flex-shrink: 0;
}

/* 文字包覆層：位於圖片上方 */
.marquee-content-txt {
  margin-bottom: calc(10 * var(--vw-base));
  /* 文字與下方圖片的間距 */
  /* 確保 line-height 不會被父層的 0 影響 */
  line-height: calc(50 * var(--vw-base));
}

.m-txt-title,
.m-txt-stitle {
  display: inline;
  /* 使用 inline 讓兩者接續在同一行 */
  white-space: nowrap;
  color: #756b66;
  font-family: 'Noto Serif TC', sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.m-txt-title {
  font-size: calc(22 * var(--vw-base));
  margin-right: calc(10 * var(--vw-base));
  /* 標題與副標之間的間距 */
}

.m-txt-stitle {
  font-size: calc(18 * var(--vw-base));
}

/* 跑馬燈圖片 */
.marquee-content img {
  height: calc(195 * var(--vw-base));
  width: auto;
  display: block;
  /* 消除圖片下方縫隙 */
}



/*main3*/
.main3 {
  position: relative;
  width: 100%;
  overflow: hidden;
  z-index: 10;
}

.m3-txt {
  position: relative;
  width: 70vw;
  margin: 8vw 0 8vw 10vw;
}

.lifescale-canvas {
  display: flex;
  width: 100%;
  position: relative;
  margin-bottom: 1vw;
}

/* --- 左側分類標記 --- */
.sidebar-indicators {
  flex: 0 0 49.2vw;
  /* 佔據較寬的左側空間 */
  position: relative;
}

.category-tag {
  width: 38.9999999999vw;
  position: absolute;
  left: 0;
  display: flex;
  align-items: flex-end;
  /* 讓文字靠下方對齊線條 */
  gap: 5vw;
  color: #756b66;
  font-size: calc(22 * var(--vw-base));
  line-height: calc(20 * var(--vw-base));
  font-weight: 700;
  font-family: 'Noto Serif TC', sans-serif;
  letter-spacing: 0.1em;
  padding: 0 0 0 10vw;
  pointer-events: none;
  /* 防止還沒出現就能點擊 */
  /*border-bottom: 1px solid rgba(117, 107, 102, 0.5);*/
}

.tag-support,
.tag-growth,
.tag-companionship {
  bottom: 0.2px;
  left: -49vw;
  right: auto;
  position: absolute;
  transition: top 0.3s ease;
}

.tag-support {
  bottom: 4.5855vw;
}

.category-tag span {
  font-size: calc(48 * var(--vw-base));
  line-height: calc(20 * var(--vw-base));
  font-family: "Lora", serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: normal;
  opacity: 0.2;
  letter-spacing: 0.1em;
  position: absolute;
  left: 6vw;
  top: -0.35vw;
  pointer-events: none;
}

/*.category-tag.tag-support span{
    top: -0.45vw;
}
.category-tag.tag-growth span{
    top: -0.35vw;
    pointer-events: none; 
}*/
.category-tag.tag-companionship span {
  top: -0.45vw;
  pointer-events: none;
}

/* --- 右側福利清單 --- */
.benefits-manifesto {
  flex: 1;
  /*border-top: 1px solid rgba(117,107,102,0.5);*/
}

.benefit-row {
  margin-top: -1px;
  display: flex;
  align-items: center;
  padding: 0 1vw;
  border-bottom: 1px solid rgba(117, 107, 102, 0.5);
  cursor: pointer;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/*.benefit-row:last-child {
    border-bottom: 1px solid rgba(117,107,102,0);
}*/

.benefit-row.benefit-row3 {
  border-bottom: 1px solid rgba(117, 107, 102, 0);
}

.benefit-row.benefit-row5 {
  border-bottom: 1px solid rgba(117, 107, 102, 0);
}

.benefit-row.benefit-row9 {
  border-bottom: 1px solid rgba(117, 107, 102, 0);
}

.benefit-row.benefit-row1::before {
  content: "";
  width: 100vw;
  height: 1px;
  position: absolute;
  top: 0;
  right: 0;
  background-color: rgba(117, 107, 102, 0.5);
  pointer-events: none;
  /* 防止還沒出現就能點擊 */
}

.benefit-row.benefit-row3::before {
  content: "";
  width: 100vw;
  height: 1px;
  position: absolute;
  bottom: 0;
  right: 0;
  background-color: rgba(117, 107, 102, 0.5);
  pointer-events: none;
  /* 防止還沒出現就能點擊 */
}

.benefit-row.benefit-row5::before {
  content: "";
  width: 100vw;
  height: 1px;
  position: absolute;
  bottom: 0;
  right: 0;
  background-color: rgba(117, 107, 102, 0.5);
  pointer-events: none;
  /* 防止還沒出現就能點擊 */
}



.row-title {
  flex: 0 0 15vw;
  font-size: calc(22 * var(--vw-base));
  line-height: 4.5855vw;
  font-weight: 700;
  font-family: 'Noto Serif TC', sans-serif;
  color: #756b66;
  letter-spacing: 0.1em;
}

.row-detail {
  flex: 1;
  font-size: calc(16 * var(--vw-base));
  line-height: 4.5855vw;
  font-weight: 600;
  letter-spacing: 0.15em;
  font-family: 'Noto Serif TC', sans-serif;
  color: #756b66;
  transition: color 0.5s;
}

/* --- Hover 效果 (對應圖片 2) --- */
.benefit-row:hover {
  background-color: #cac0b7;
  /* 滑入變色 */
}

.benefit-row:hover .row-title,
.benefit-row:hover .row-detail {
  color: #fff;
  /* 文字轉白 */
}

/* 讓 JS 接手前，先手動隱藏這些元件，避免閃現 */
.m3-txt-title,
.m3-txt-cent,
.lifescale-canvas,
.category-tag,
.benefit-row {
  opacity: 0;
}

.m3-txt-title {
  width: calc(1000*var(--vw-base));
  overflow: hidden;
  color: #756b66;
  font-size: calc(22 * var(--vw-base));
  line-height: calc(45 * var(--vw-base));
  font-weight: 700;
  font-family: 'Noto Serif TC', sans-serif;
  letter-spacing: 0.1em;
}

.m3-txt-cent {
  width: calc(1000*var(--vw-base));
  overflow: hidden;
  color: #756b66;
  font-size: calc(16 * var(--vw-base));
  line-height: calc(33 * var(--vw-base));
  font-family: 'Noto Serif TC', sans-serif;
  letter-spacing: 0.05em;
  text-align: justify;
  text-align-last: left;
  text-justify: inter-ideograph;
}



/* =========================================
   MAIN4
========================================= */
.main4 {
  position: relative;
  width: 100%;
  height: calc(950*var(--vw-base));
  overflow: hidden;
  background-color: #eae0d7;
  z-index: 10;
}

.main4>img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 標題區 */
.m4-txt {
  position: absolute;
  top: 0vw;
  left: 0;
  width: 50vw;
  z-index: 105;
}

.m4-txt-title {
  position: absolute;
  left: 10.4vw;
  top: 3.5vw;
  width: calc(287 * var(--vw-base));
  height: calc(365 * var(--vw-base));
  transition: all .35s ease-in-out;
  opacity: 0;
}

.m4-txt-title .t1 {
  color: #b6aaa0;
  font-family: "Lora", serif;
  font-weight: 600;
  font-size: calc(48 * var(--vw-base));
  line-height: 3vw;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
}

.m4-txt-title .t2 {
  position: absolute;
  left: -7.6vw;
  top: 8vw;
  color: #b6aaa0;
  width: 10vw;
  text-align: right;
  line-height: 3vw;
  font-size: calc(22 * var(--vw-base));
  font-family: 'Noto Serif TC', sans-serif;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.m4-txt-title.active {
  animation: m4-title 1.5s ease;
  animation-delay: 1s;
  animation-fill-mode: forwards;
}

@keyframes m4-title {
  0% {
    opacity: 0;
    left: 9.4vw;
  }

  100% {
    opacity: 1;
    left: 10.4vw;
  }
}


.m4-txt-title img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.m4-txt-line {
  width: 0vw;
  height: 1px;
  background-color: rgba(89, 80, 76, 1);
  position: absolute;
  left: 9.8vw;
  top: 0.45vw;
  transition: all .5s ease-in-out;
}

.m4-txt-line.active {
  animation: m4-line 1s linear;
  animation-delay: 1s;
  animation-fill-mode: forwards;
}

@keyframes m4-line {
  0% {
    width: 0vw;
  }

  100% {
    width: 4.5vw;
  }
}

/* 左側遮罩圖 */
.m4-mask {
  width: calc(260*var(--vw-base));
  height: calc(950*var(--vw-base));
  z-index: 90;
  position: absolute;
  left: 0;
  top: 0;
}

/* 分隔線（你原本三條線） */
.m4-line1,
.m4-line2,
.m4-line3 {
  width: 1px;
  height: calc(0*var(--vw-base));
  background-color: rgba(137, 126, 121, 0.5);
  position: absolute;
  overflow: hidden;
  z-index: 100;
}

.m4-line4,
.m4-line5 {
  width: 100%;
  height: 1px;
  background-color: rgba(137, 126, 121, 0.5);
  position: absolute;
  overflow: hidden;
  z-index: 100;
}

.m4-line4 {
  position: absolute;
  top: 0;
  left: 0;
}

.m4-line5 {
  position: absolute;
  bottom: 0;
  left: 0;
}

.m4-line1 {
  left: 12.7vw;
  top: 0;
}

.m4-line2 {
  left: 69vw;
  bottom: 0;
}

.m4-line3 {
  left: 86.5vw;
  top: 0;
}

.m4-line1.active {
  animation: m4-1-line 2s linear;
  animation-fill-mode: forwards;
}

.m4-line2.active {
  animation: m4-2-line 2s linear;
  animation-delay: 0.5s;
  animation-fill-mode: forwards;
}

.m4-line3.active {
  animation: m4-3-line 2s linear;
  animation-delay: 1s;
  animation-fill-mode: forwards;
}

@keyframes m4-1-line {
  from {
    height: 0
  }

  to {
    height: calc(1950*var(--vw-base));
  }
}

@keyframes m4-2-line {
  from {
    height: 0
  }

  to {
    height: calc(1950*var(--vw-base));
  }
}

@keyframes m4-3-line {
  from {
    height: 0
  }

  to {
    height: calc(1950*var(--vw-base));
  }
}


/* ===============================
   M4 基本版型
================================ */
:root {
  /* ===== 等比系統（照你站的慣例） ===== */
  --vw-base: calc(100vw / 1920);

  --bg: #eae0d7;
  --ink: #111;
  --muted: rgba(0, 0, 0, .55);
  --line: rgba(0, 0, 0, .18);

  /* ===== 線位置（照圖） ===== */
  --line2: 69vw;
  --line3: 86.5vw;

  /* ===== 卡片尺寸（照圖：正方形） ===== */
  --cardW: calc(336 * var(--vw-base));
  --imgH: calc(336 * var(--vw-base));

  /* 向上長的高度 */
  --imgGrow: calc(50 * var(--vw-base));

  /* ===== 關鍵：間距（照圖偏大） =====
     設計稿 px(@1920)，JS 會換算成 px */
  --gapDesign: 185;

  /* ===== 關鍵：讓第 3 張落在兩線中間 =====
     這個值我已經用「目標 band 中心」反推過，參考圖會很接近 */
  --stageLeft: calc(283 * var(--vw-base));

  /* ===== 右邊露出第四張 ===== */
  --peek: calc(230 * var(--vw-base));
}

/* ✅ 裁切到「線3 + peek」：只露一點點第四張 */
.m4-clip {
  position: relative;
  width: calc(var(--line3) + var(--peek));
  max-width: 100vw;
  overflow: visible;
  margin-top: calc(150 * var(--vw-base));
  z-index: 80;
}


/* Swiper */
#m4Swiper {
  width: 100%;
  overflow: visible;
}

#m4Swiper .swiper-wrapper {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  padding-left: var(--stageLeft);
}

#m4Swiper .swiper-slide {
  width: var(--cardW) !important;
  flex: 0 0 auto !important;
  margin-right: 0;
  /* 間距交給 spaceBetween */
}

#m4Swiper {
  position: relative;
  /* ✅ 讓 Swiper 容器本身覆蓋你想要可拖的整塊高度
     你可以依你的版型調大一點 */
  padding-bottom: calc(120 * var(--vw-base));
}

#m4Swiper .m4-drag-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* ✅ 在背後 */
  background: transparent;
}

/* ✅ slides / scrollbar 在上層 */
#m4Swiper .swiper-wrapper,
#m4Swiper .swiper-scrollbar {
  position: relative;
  z-index: 2;
}

/* 游標手勢（可選） */
.m4-clip {
  cursor: grab;
}

.m4-clip:active {
  cursor: grabbing;
}


/* 卡片 */
.m4-card {
  display: block;
  text-decoration: none;
  color: inherit;
  user-select: none;
}

/* ✅ 1) thumb 永遠固定「最大高度」 */
.m4-thumb {
  position: relative;
  width: 100%;
  height: calc(var(--imgH) + var(--imgGrow));
  /* ✅ 最大高度 */
  overflow: hidden;
  background: #000;

  /* ✅ 預設裁切：只顯示 imgH（從上裁掉 grow 的量） */
  clip-path: inset(var(--imgGrow) 0 0 0);
  transition: clip-path 0.8s cubic-bezier(.16, 1, .3, 1);
  will-change: clip-path;
}

/* ✅ 2) 圖片：底部對齊（很重要） */
.m4-thumb img {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  /* ✅ 貼底 */
  top: auto;
  /* ✅ 不要 top:0 */
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  /* ✅ 取景偏底 */
  display: block;
}

/* ✅ 3) 遮色片：預設開 */
.m4-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: #59504c;
  opacity: 0.5;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.55s cubic-bezier(.2, .8, .2, 1);
  will-change: opacity;
}


.m4-sline {
  width: 1vw;
  height: 1px;
  position: relative;
  margin: 1vw 0.5vw 0 0.5vw;
  padding: 0;
  background-color: #897e79;
}

.m4-meta {
  width: 100%;
  position: relative;
  padding-top: 10px;
}

.m4-date {
  font-size: calc(22 * var(--vw-base));
  line-height: calc(30 * var(--vw-base));
  letter-spacing: .2em;
  color: #897e79;
  margin: 0;
  font-family: "Lora", serif;
  font-weight: 600;
  padding: 0 10px;
}

.m4-title {
  letter-spacing: .2em;
  margin: 0;
  color: #897e79;
  font-size: calc(22 * var(--vw-base));
  line-height: calc(22 * var(--vw-base));
  font-family: "Noto Serif TC";
  font-weight: 700;
  padding: 0 10px;
}

.m4-sline {
  width: 1vw;
  height: 1px;
  position: relative;
  margin: 1vw 0.5vw 0 0.5vw;
  padding: 0;
  background-color: #897e79;
}

.m4-desc {
  letter-spacing: .2em;
  margin: 0;
  color: #897e79;
  font-size: calc(16 * var(--vw-base));
  font-family: "Noto Serif TC";
  line-height: calc(30 * var(--vw-base));
  opacity: 0;
  transition: opacity 0.55s cubic-bezier(.2, .8, .2, 1);
  will-change: opacity;
  text-align: justify;
  text-align-last: left;
  text-justify: inter-ideograph;
  padding: 20px 10px;
}

.m4-date,
.m4-title,
.m4-desc {
  display: block;
  transform: scaleX(0.95);
  transform-origin: left center;
}

#m4-news-swiper .swiper-slide.is-focus .m4-desc {
  opacity: 1;
}

/* slot4 首屏隱藏 */
#m4-news-swiper .swiper-slide.is-slot4.is-hidden {
  opacity: 0;
}

/* ✅ focus：遮色片關 + desc 顯示（你原本保留） */
.swiper-slide.is-focus .m4-thumb::after {
  opacity: 0;
}

/* ===============================
   scrollbar
================================ */
#m4-scroll {
  position: absolute !important;
  left: 15vw !important;
  right: auto !important;
  top: 37vw !important;
  bottom: auto !important;
  width: 50vw;
  /* 確保有寬度 */
  height: 3px !important;
  margin: 0 !important;
  background: transparent !important;
  overflow: hidden !important;
  border-radius: 0 !important;
  z-index: 10;
  cursor: pointer;
}

#m4-scroll .m4-scrollbar-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 3px;
  background-image: url(../img/m4-barbg.png);
  background-position: 100% 50%;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  z-index: 0;
}

#m4-scroll .swiper-scrollbar-drag {
  height: 1px !important;
  width: 100%;
  position: relative;
  background: rgba(89, 80, 76, 1);
  border-radius: 0;
  left: 0;
  top: 0;
}

/* 這是那個關鍵的「右側特別圖案」 */
.m4-special-pattern {
  position: absolute;
  right: 0;
  top: 0;
  width: 19px;
  height: 3px;
  background-image: url(../img/m4-barbgafdot.png);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: right center;

  opacity: 0;
  /* 預設隱藏 */
  transition: opacity 0.3s ease-out 0.1s;
  z-index: 3;
  /* 確保在 drag 之上或之下，視設計而定 */
  pointer-events: none;
}

/* 當 JS 判定到最右邊時，切換此 Class */
#m4-scroll.is-at-end .m4-special-pattern {
  opacity: 1;
}


/* ✅ focus：永遠是兩線中間那張 */
.swiper-slide.is-focus .m4-thumb::after {
  opacity: 0;
}

.swiper-slide.is-focus .m4-desc {
  opacity: 1;
}


/* 1) clip 當定位容器，避免 absolute 層亂飛 */
#main4 .m4-clip {
  position: relative;
}

/* 2) 裝飾層永遠不吃事件（避免偶發蓋住 swiper） */
#main4 .m4-drag-layer,
#main4 .m4-mask {
  pointer-events: none;
}

/* 3) Shield：預設完全穿透；只有 is-on 才擋 */
#main4 .m4-hover-shield {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 20;
  /* 只要高於卡片即可，不要亂拉到 999 */
  pointer-events: none !important;
}

#main4 .m4-hover-shield.is-on {
  pointer-events: auto;
  /* 開啟時才擋 */
}

/* 4) 確保 swiper / 卡片層在 shield 底下（或同層） */
#main4 #m4Swiper {
  position: relative;
  z-index: 10;
}

/* 如果你的 .m4-card 有自己的 z-index，可補強一下 */
#main4 .m4-card {
  position: relative;
  z-index: 11;
}


/* ✅ 只要在滑動/拖曳狀態，一律保持低（不管 hover 不 hover） */
#main4.is-dragging-m4 #m4Swiper .m4-thumb {
  clip-path: inset(var(--imgGrow) 0 0 0) !important;
}

/* ✅ 只有「視覺鎖定」那張，滑到圖片才變高 */
#m4Swiper .swiper-slide.is-focus-lock .m4-thumb:hover,
#m4Swiper .swiper-slide.is-focus-lock .m4-thumb:focus-within {
  clip-path: inset(0 0 0 0);
}

/* 遮色片/desc 也只在「focus-lock + hover 到圖片」才出現變化 */
.m4-thumb::after {
  opacity: .5;
  transition: opacity .55s cubic-bezier(.2, .8, .2, 1);
}

.m4-desc {
  opacity: 0;
  transition: opacity .55s cubic-bezier(.2, .8, .2, 1);
}

#m4Swiper .swiper-slide.is-focus-lock .m4-thumb:hover::after,
#m4Swiper .swiper-slide.is-focus-lock .m4-thumb:focus-within::after {
  opacity: 0;
}

#m4Swiper .swiper-slide.is-focus-lock .m4-thumb:hover~.m4-meta .m4-desc,
#m4Swiper .swiper-slide.is-focus-lock .m4-thumb:focus-within~.m4-meta .m4-desc {
  opacity: 1;
}

/* ✅ 拖曳中完全禁止 hover 展開（防抖） */
#main4.is-dragging-m4 .m4-thumb:hover {
  clip-path: inset(var(--imgGrow) 0 0 0) !important;
}

#main4.is-dragging-m4 .m4-thumb:hover::after {
  opacity: .5 !important;
}

#main4.is-dragging-m4 .m4-thumb:hover~.m4-meta .m4-desc {
  opacity: 0 !important;
}