:root {
  --bg-color: #f3f0eb;
  --title-color: #2d2e36;
  --accent-color: #d18b80;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
  position: relative;
}

body {
  background-color: var(--bg-color);
  font-family: "Noto Serif TC", serif;
  padding-bottom: 60px;
}

.main-banner {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-color);
}

/* 背景圖層 */
.banner-bg-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.bg-layer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}

.bg-left {
  left: 0;
  bottom: -3%;
  width: 80%;
  z-index: 2;
}

.bg-right {
  top: 0;
  bottom: auto;
  right: 0;
  width: 25%;
  z-index: 1;
}

/* 內容層 */
.banner-content {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 飛鳥 */
.birds-wrapper {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

.bird {
  position: absolute;
  width: 10vw;
  max-width: 150px;
  height: auto;
}

.bird-left {
  top: 25%;
  left: 15%;
}

.bird-right {
  top: 35%;
  right: 15%;
}

/* 文字組 */
.text-group {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.main-title-wrapper {
  width: 30vw;
  max-width: 500px;
  margin-bottom: 10px;
}

.main-title {
  width: 100%;
  height: auto;
}

.description-wrapper {
  width: 70vw;
  max-width: 900px;
  margin-bottom: 15px;
}

.description-img {
  width: 100%;
  height: auto;
}

/* 底部導覽列 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: #434551;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  gap: 8px;
  position: relative;
}

.nav-item::after {
  content: "";
  position: absolute;
  right: 0;
  top: 20%;
  width: 1px;
  height: 60%;
  background-color: rgba(255, 255, 255, 0.3);
}

.nav-item:last-child::after {
  display: none;
}

.nav-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.nav-item span {
  font-size: 10px;
  letter-spacing: 1px;
}

/* RWD Helpers */
.mobile-only {
  display: none !important;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 80px;
  }

  .pc-only {
    display: none !important;
  }
  .mobile-only {
    display: block !important;
  }

  .main-banner {
    height: 100vh;
  }

  /* 文字組 */
  .text-group {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .main-title-wrapper {
    width: 50vw;
    max-width: 230px;
    padding-top: 100px;
    margin-bottom: 10px;
  }

  .main-title {
    width: 100%;
    height: auto;
  }

  .description-wrapper {
    width: 70vw;
    max-width: 260px;
    margin-bottom: 15px;
  }

  .description-img {
    width: 100%;
    height: auto;
  }

  /* 背景定位 - 手機版山景在底部 */
  .bg-left-m {
    left: 0;
    bottom: -20px; /* 稍微向上提 */
    width: 70%;
    z-index: 3;
  }
  .bg-right-m {
    right: 0;
    bottom: 0px;
    width: 36%;
    z-index: 2;
  }

  /* PC 的右上雲層 (bg-right) 保持出現，但手機版縮小點 */
  .bg-right {
    width: 65%;
    opacity: 0.3;
    top: 0;
  }

  /* 飛鳥重新定位 (手機版) */
  .bird-left {
    top: 10%;
    left: 5%;
    width: 15%;
  }
  .bird-right {
    bottom: 20%;
    right: 3%;
    top: auto;
    width: 22%;
  }

  /* 文字排版微調 */
  .main-title-wrapper {
    width: 80vw;
  }
  .description-wrapper {
    width: 90vw;
    margin-top: 10px;
  }

  .text-group {
    gap: 15px;
    margin-top: -20vh;
  }

  .bottom-nav {
    height: 80px; /* 完全鎖定固定高度，不使用動態變數，防止抖動 */
    padding-bottom: 0;
  }
}

/* 預約鑑賞 */
.contact-section {
  position: relative;
  width: 100%;
  padding: 80px 5%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20; /* 確保層級高於上一區塊的底部裝飾 (-115px 那張山脈) */
}

.contact-container {
  width: 100%;
  max-width: 1200px;
}

.contact-title-wrapper {
  text-align: center;
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
}

.contact-title-img {
  width: 200px; /* Adjust size as needed */
  height: auto;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.map-wrapper {
  width: 100%;
  border: 1px solid #dab5ac;
  padding: 10px;
}

.map-wrapper iframe {
  width: 100%;
  height: 450px;
  display: block;
  border: 0;
}

.contact-form {
  display: flex;
  flex-direction: column;
}

.hidden-honeypot {
  display: none !important;
}

.form-row {
  display: flex;
  gap: 15px;
}

.input-wrapper {
  position: relative;
  margin-bottom: 25px;
  width: 100%;
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #dab5ac;
  background-color: transparent;
  font-size: 15px;
  color: #434551;
  outline: none;
}

.form-select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23434551' d='M2 4l4 4 4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 12px;
}

/* 驗證樣式 */
.error-message {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  font-size: 12px;
  color: #d9534f;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.form-agreement .error-message {
  position: relative;
  top: 0;
  margin-top: 5px;
}

.validation-icon {
  position: absolute;
  right: 12px;
  top: 13px;
  width: 18px;
  height: 18px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
}

.form-select + .validation-icon {
  right: 35px;
}

.input-wrapper.is-invalid .form-input,
.input-wrapper.is-invalid .form-select {
  border-color: #d9534f;
}

.input-wrapper.is-invalid .error-message,
.input-wrapper.is-invalid .validation-icon {
  opacity: 1;
  visibility: visible;
}

.input-wrapper.is-invalid .validation-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9534f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
}

.input-wrapper.is-valid .form-input,
.input-wrapper.is-valid .form-select {
  border-color: #5cb85c;
}

.input-wrapper.is-valid .validation-icon {
  opacity: 1;
  visibility: visible;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235cb85c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'%3E%3C/path%3E%3Cpolyline points='22 4 12 14.01 9 11.01'%3E%3C/polyline%3E%3C/svg%3E");
}

.input-wrapper.form-agreement.is-invalid .checkmark {
  border-color: #d9534f;
}

.input-wrapper.form-agreement.is-valid .checkmark {
  border-color: #5cb85c;
}

.form-submit-btn {
  width: 100%;
  background-color: #d1b1a7;
  color: #fff;
  border: none;
  padding: 15px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: background-color 0.3s ease;
  letter-spacing: 2px;
}

.form-submit-btn:hover {
  background-color: #c1a197;
}

.form-agreement {
  margin-top: 20px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  font-size: 14px;
  color: #434551;
}

.form-checkbox {
  opacity: 0;
  position: absolute;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 1px solid #d1c6b1;
  margin-right: 10px;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  background: #fff;
  margin-top: 2px;
}

.form-checkbox:checked ~ .checkmark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: solid #434551;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.agreement-text {
  line-height: 1.5;
}

.privacy-link {
  color: #d18b80;
  text-decoration: underline;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: #fff;
  width: 90%;
  max-width: 600px;
  padding: 40px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 30px;
  cursor: pointer;
  color: #434551;
}

.modal-title {
  font-size: 24px;
  margin-bottom: 20px;
  color: #434551;
  text-align: center;
}

.modal-body {
  max-height: 400px;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.8;
  color: #434551;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .contact-section {
    padding: 50px 5%;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .contact-title-img {
    width: 150px; /* Mobile size */
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

/* Footer Styles */
.main-footer {
  background-color: #f8f8f8;
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid #eee;
}

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

.copyright {
  color: #888;
  font-size: 14px;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .main-footer {
    padding: 30px 0;
  }
}

/* ==========================================================================
   Map Style Visual Section (Ref: Phoenix Mansion)
   ========================================================================== */
.map-section {
  position: relative;
  width: 100%;
  background-color: #fff;
  overflow: hidden;
}

.map-scroll-container {
  width: 100%;
  overflow: hidden;
}

.map-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* --- Swipe Hint Overlay (Mobile Only) --- */
.swipe-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  z-index: 9;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.swipe-overlay.hidden {
  opacity: 0;
}

.swipe-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 15px 25px;
  border-radius: 30px;
  pointer-events: none;
  opacity: 0.9;
  transition: opacity 0.5s ease;
}

.swipe-hint.hidden {
  opacity: 0;
  visibility: hidden;
}

.swipe-hint span {
  font-size: 14px;
  letter-spacing: 1px;
  margin-top: 8px;
  white-space: nowrap;
}

.swipe-icon {
  width: 30px;
  height: 20px;
  position: relative;
  animation: swipeMotion 1.5s ease-in-out infinite alternate;
}

.swipe-icon::before,
.swipe-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-top: 2px solid white;
  border-right: 2px solid white;
}

.swipe-icon::before {
  left: 0;
  transform: translateY(-50%) rotate(-135deg);
}

.swipe-icon::after {
  right: 0;
  transform: translateY(-50%) rotate(45deg);
}

@keyframes swipeMotion {
  from {
    transform: translateX(-10px);
  }
  to {
    transform: translateX(10px);
  }
}

/* --- Decorative SVG Divider --- */
.section-divider-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  display: block;
  z-index: 15;
}

/* --- Utility for Responsive Display --- */
.d-md-none {
  display: none !important;
}

/* --- Mobile Responsive (Map behavior) --- */
@media (max-width: 768px) {
  .section-divider-svg {
    top: -15px;
  }

  .d-md-none {
    display: flex !important;
  }

  .map-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .map-scroll-container::-webkit-scrollbar {
    display: none;
  }

  .map-scroll-container .map-image {
    width: 250%; /* Force horizontal scroll */
    max-width: none;
    height: auto;
  }
}

/* ==========================================================================
   TSMC Science Park Section
   ========================================================================== */
.tsmc-section {
  position: relative;
  background-color: var(--bg-color);
  padding: 100px 0 150px;
  overflow: hidden;
}

/* Swiper 基礎容器 */
.tsmc-swiper {
  width: 100%;
  position: relative;
  padding-bottom: 50px; /* 為箭頭留出空間感 */
}

/* 簡約導覽箭頭 */
.tsmc-swiper-prev,
.tsmc-swiper-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  z-index: 20;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.tsmc-swiper-prev {
  left: 20px;
}

.tsmc-swiper-next {
  right: 20px;
}

.tsmc-swiper-prev:hover,
.tsmc-swiper-next:hover {
  opacity: 1;
  scale: 1.1;
}

.tsmc-swiper-prev svg,
.tsmc-swiper-next svg {
  width: 100%;
  height: 100%;
}

.tsmc-swiper-prev path,
.tsmc-swiper-next path {
  fill: none;
  stroke: #4a4a4a;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 分頁點樣式 (PC 版預設隱藏) */
.tsmc-pagination {
  display: none;
}

.tsmc-pagination .swiper-pagination-bullet {
  background: #4a4a4a;
  opacity: 0.3;
  width: 10px;
  height: 10px;
  margin: 0 6px !important;
  transition: all 0.3s ease;
}

.tsmc-pagination .swiper-pagination-bullet-active {
  opacity: 1;
  width: 25px;
  border-radius: 5px;
}

@media (max-width: 1600px) {
  .tsmc-swiper-prev {
    left: 10px;
  }
  .tsmc-swiper-next {
    right: 10px;
  }
}

@media (max-width: 768px) {
  .tsmc-section {
    padding-bottom: 80px;
  }
  .tsmc-swiper {
    padding-bottom: 50px !important; /* 強制為分頁點保留 50px 的安全高度，避免疊到內容 */
  }
  .tsmc-swiper-prev,
  .tsmc-swiper-next {
    display: none; /* 手機版隱藏箭頭 */
  }

  /* 手機版顯示分頁點 */
  .tsmc-pagination {
    display: block;
    position: absolute;
    bottom: 0px !important; /* 將分頁點放在保留的安全高度內 */
    z-index: 25;
  }
}

.tsmc-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  gap: 40px;
  z-index: 5;
  position: relative;
}

.tsmc-visual {
  flex: 0 0 50%; /* 縮小一點點 */
}

.tsmc-aerial-img {
  width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.tsmc-content {
  flex: 0 0 35%;
  position: relative;
}

.slogan-wrapper {
  position: relative;
  padding: 20px 0;
}

.tsmc-slogan {
  width: 80%;
  height: auto;
  display: block;
  margin: 0 auto;
  position: relative;
  z-index: 10; /* 確保標語在飛鳥上方 */
}

/* 鹽行標語間距 (用於 Slide 2) */
.tsmc-yanhang-slogan {
  margin-top: 45px !important;
}

.tsmc-expansion-img {
  width: 80%;
  height: auto;
  display: block;
  margin: 45px auto 0; /* 增加間距並居中 */
  position: relative;
  z-index: 10; /* 確保標語在飛鳥上方 */
}

/* 飛鳥定位 */
.tsmc-bird {
  position: absolute;
  width: 80px;
  height: auto;
  z-index: 2;
  opacity: 0.8;
}

.tsmc-bird-1 {
  top: -50px;
  left: 0%;
  width: 90px; /* 單鳥縮小 */
}

.tsmc-bird-2 {
  top: -60px;
  right: -5%;
  width: 200px; /* 雙鳥組合縮小 */
}

/* 山脈陰影 */
.tsmc-mountain-overlay {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  z-index: 100; /* Desktop 置於最上層 */
  pointer-events: none;
}

.tsmc-mountain {
  width: 100%;
  height: auto;
  display: block;
}

/* RWD for TSMC Section */
@media (max-width: 768px) {
  .tsmc-section {
    padding: 30px 0 100px;
  }

  .tsmc-container {
    flex-direction: column;
    gap: 30px;
    width: 100%;
  }

  .tsmc-visual {
    flex: 0 0 100%;
    width: 100%;
  }

  .tsmc-content {
    flex: 0 0 100%;
    width: 90%;
    margin: 0 auto;
    text-align: center;
  }

  .tsmc-slogan {
    max-width: 100%;
    margin: 0 auto;
  }

  .tsmc-expansion-img {
    width: 70%; /* 手機版縮小比例，避免圖片過大 */
    margin: 30px auto 0;
  }

  .tsmc-bird {
    width: 60px;
  }

  .tsmc-bird-1 {
    top: 70px; /* 再次大幅調降 */
    left: 5%;
    width: 40px;
  }

  .tsmc-bird-2 {
    top: 80px; /* 再次大幅調降 */
    right: 5%;
    width: 140px;
  }

  /* Mobile 山脈陰影置底 */
  .tsmc-mountain-overlay {
    z-index: 0;
  }
}

/* ==========================================================================
   交通機能區塊 (Traffic Section)
   ========================================================================== */

/* 交通區塊專屬背景與間距 */
.traffic-section {
  background-color: var(--bg-color);
  padding-top: 50px; /* 縮小與上方區塊的間距感 */
}

/* 反轉佈局：左文右圖 */
.traffic-container {
  flex-direction: row-reverse !important;
}

/* 單飛鳥定位 */
.traffic-bird {
  position: absolute;
  top: -60px;
  left: 0;
  width: 120px;
  opacity: 0.8;
  z-index: 5;
}

/* 確保分頁點配色一致 */
.traffic-pagination .swiper-pagination-bullet {
  background: #4a4a4a !important;
}

/* RWD 調整 */
@media (max-width: 768px) {
  .traffic-section {
    padding-top: 20px;
  }

  .traffic-container {
    flex-direction: column !important; /* 手機版維持圖片在上，標語在下 */
  }

  .traffic-bird {
    top: -20px;
    left: 10%;
    width: 60px;
  }
}

/* ==========================================================================
   生活機能區塊 (Lifestyle Section)
   ========================================================================== */

.lifestyle-section {
  background-color: var(--bg-color);
  padding-top: 50px;
  padding-bottom: 220px; /* 大幅增加底部間距，確保山脈線條不遮擋圖片 */
}

/* 恢復預設佈局：左圖右文 (不需要額外 flex-direction) */

/* 單飛鳥定位 */
.lifestyle-bird {
  position: absolute;
  top: -50px;
  right: 0;
  width: 120px;
  opacity: 0.8;
  z-index: 5;
}

/* 確保分頁點配色一致 */
.lifestyle-pagination .swiper-pagination-bullet {
  background: #4a4a4a !important;
}

/* RWD 調整 */
@media (max-width: 768px) {
  .lifestyle-section {
    padding-top: 20px;
  }

  .lifestyle-bird {
    top: -30px;
    right: 10%;
    width: 60px;
  }
}

/* ==========================================================================
   名家聯袂區塊 (Expert Section)
   ========================================================================== */

.expert-section {
  position: relative;
  background-color: var(--bg-color);
  padding: 80px 0 120px;
  overflow: hidden;
}

.expert-title-wrapper {
  text-align: center;
  margin-bottom: 60px;
}

.expert-section-title {
  height: 48px;
  width: auto;
}

/* 這裡移除了重複的 @media (min-width: 769px) 佈局設定，原本的邏輯已整併至後方的媒體查詢中 */

/* 專家卡片結構 */
.expert-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.expert-visual {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 25px;
}

.expert-portrait-box {
  position: relative;
  width: 100%;
  max-width: 320px; /* 限制最大寬度防止過大 */
  height: 450px; /* 統一桌機版視覺高度 */
  display: flex;
  justify-content: center;
  align-items: flex-end; /* 所有肖像底部對齊，確保影水平線一致 */
}

.expert-portrait {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Desktop 佈局：三欄併排與圖片比例補償 */
@media (min-width: 769px) {
  .expert-swiper {
    overflow: visible;
  }

  .expert-swiper .swiper-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    transform: none !important;
  }

  .expert-slide {
    width: calc(33.33% - 20px) !important;
  }

  /* 針對肖像份量感進行個別補償 (僅 PC 執行，避免手機滿版變形) */
  .expert-slide:nth-child(1) .expert-portrait {
    transform: scale(1.35);
    transform-origin: bottom center;
  }

  .expert-slide:nth-child(3) .expert-portrait {
    transform: scale(1.4);
    transform-origin: bottom center;
  }
}

/* 底部裝飾線 */
.expert-bg-decor {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 1;
}

.expert-horizon-line {
  width: 100%;
  height: auto;
  opacity: 0.6;
}

/* Mobile Swiper 模式 */
@media (max-width: 768px) {
  .expert-section {
    padding: 0 0 100px;
  }

  .expert-title-wrapper {
    padding-top: 150px; /* 大幅增加頂部間距，確保完全避開背景線 */
    margin-bottom: 80px; /* 增加與底下輪播圖的間距 */
    position: relative;
    z-index: 10; /* 確保標題層級較高 */
  }

  .expert-section-title {
    height: 28px; /* 調大標題，確保手機版清晰可見 */
  }

  .expert-bg-decor {
    bottom: auto;
    top: 0;
    z-index: 1;
    height: 120px; /* 提高底座高度確保標題有足夠空間 */
    overflow: hidden;
  }

  .expert-horizon-line {
    opacity: 0.5;
    transform: scale(1.4) translateY(0); /* 微調位置 */
  }

  .expert-swiper {
    padding-bottom: 120px !important; /* 為分頁點預留更多空間 */
  }

  .expert-visual {
    margin-bottom: 0;
  }

  .expert-portrait-box {
    height: 380px; /* 微調高度維持平衡 */
    width: 90%;
    max-width: none;
  }

  .expert-pagination {
    bottom: 0px !important; /* 向下移動點點防止與肖像重疊 */
  }

  .expert-portrait {
    transform: none !important; /* 僅在手機版強制關閉縮放，防止 Swiper 跳動 */
  }
}

/* --- 國際精工建材區塊 (Craftsmanship Section) --- */
.craft-section {
  position: relative;
  padding: 100px 0;
  overflow: hidden;
  z-index: 10; /* 提升層級以確保底部裝飾能蓋在下一區塊之上 */
}

.craft-title-wrapper {
  text-align: center;
  margin-bottom: 60px;
  position: relative;
  z-index: 10;
}

.craft-section-title {
  height: 80px; /* 大幅增加標題圖片尺寸 */
  width: auto;
  margin-bottom: 50px;
  max-width: 90%; /* 確保標題不會超出容器 */
}

.craft-swiper {
  position: relative;
  z-index: 10;
  overflow: visible;
  max-width: 1200px; /* 限制寬度以利水平置中 */
  margin: 0 auto; /* 水平置中 */
}

/* Desktop Grid 佈局 - 嚴格 7 欄橫排並縮小間距確保不換行 */
@media (min-width: 769px) {
  .craft-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important; /* 強制 7 欄 */
    gap: 15px; /* 給予均勻間距 */
    transform: none !important;
    width: 100% !important;
    max-width: 1140px !important; /* 配合常見的容器寬度 */
    margin: 0 auto !important; /* 強制水平置中 */
    justify-content: center !important; /* 確保內容置中 */
    align-items: flex-start !important; /* 頂部對齊以防高度落差 */
  }

  .craft-slide {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column; /* 讓圖片與下方的文字垂直排列 */
    align-items: center !important; /* 確保內部元素水平置中 */
    justify-content: center;
    text-align: center;
  }

  /* 隱藏 Swiper 可能產生的複製品，確保格線只有 7 個正本 */
  .craft-slide.swiper-slide-duplicate {
    display: none !important;
  }

  /* 縮小中間的「匠心嚴選」圖示比例 */
  .craft-slide:nth-child(4) .craft-img {
    max-width: 60% !important; /* 再縮小一點 */
  }
}

.craft-card {
  background: transparent !important; /* 強制移除背景 */
  border: none !important; /* 強制移除邊框 */
  box-shadow: none !important; /* 強制移除陰影 */
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  height: 100%;
  transition: transform 0.3s ease;
}

.craft-card:hover {
  transform: translateY(-5px);
}

.craft-img {
  width: 100%; /* 寬度跟隨格線容器 */
  height: auto;
  max-height: 160px; /* 限制最高高度防止過長 */
  object-fit: contain;
  margin: 0 auto; /* 強制水平置中 */
  display: block;
}

/* 背景飾線 */
.craft-bg-decor {
  position: relative;
  width: 100%;
  margin-top: -50px; /* 使用負毛邊將背景區塊向上抽回，增加與內容的重疊度 */
  pointer-events: none;
  z-index: 1;
}

.craft-mountain-bg {
  position: relative;
  display: block;
  width: 100% !important;
  height: auto;
}

.craft-dashed-bg {
  position: absolute;
  top: 10%;
  left: -5%;
  width: 50%;
}

/* Mobile Swiper 模式 */
@media (max-width: 768px) {
  .craft-section {
    padding: 60px 0 120px;
  }

  .craft-title-wrapper {
    margin-bottom: 15px; /* 大幅縮短標題與下方的間距 */
  }

  .craft-section-title {
    width: 90%; /* 取消固定高度，改用無自適應寬度，讓標題大幅變大 */
    max-width: 320px;
    height: auto;
  }

  .craft-swiper {
    padding-bottom: 0;
    overflow: visible;
  }

  .craft-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important; /* 手機版改為 3 欄 2 列 */
    gap: 15px;
    transform: none !important;
    width: 100% !important;
    max-width: 85%;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .craft-slide {
    width: 100% !important;
    height: auto !important;
  }

  .craft-pagination {
    display: none !important; /* 取消輪播點點 */
  }

  /* 手機版背景調整 */
  .craft-bg-decor {
    margin-top: -100px;
  }

  .craft-mountain-bg {
    width: 100% !important; /* 使山脈背景完美滿版全寬 */
    margin: 0 !important;
    left: 0;
  }

  /* 手機版匠心嚴選獨立圖示 */
  .craft-mobile-icon {
    display: block;
    text-align: center;
    width: 100%;
    margin: 0 auto 50px auto; /* 增加與下方標題的間距 */
    position: relative;
    z-index: 10;
  }

  .craft-mobile-img {
    display: inline-block;
    margin: 0 auto;
    width: 120px; /* 放大圖示比例 */
    height: auto;
    margin-bottom: 40px;
  }
}

/* --- 建築美學外觀區塊 (Exterior Section) --- */
.exterior-section {
  position: relative;
  width: 100%;
  padding: 0;
  overflow: visible; /* 改為 visible 以免底部彩繪山脈被裁切 */
  margin-top: -150px; /* 這裡負 margin 是為了讓上一區塊的山脈自然疊加在上方 */
  margin-bottom: 50px;
  z-index: 5; /* 確保位於上一區塊的下方，讓裝飾疊加上來 */
}

.exterior-bg-wrapper {
  position: relative; /* 讓圖片自然撐開高度，維持 16:9 原始比例 */
  width: 61%; /* 圖片佔據左側約 61% */
  z-index: 0;
  line-height: 0; /* 移除底部間隙 */
}

.exterior-bg {
  width: 100%;
  height: auto; /* 放棄 cover，直接使用圖片真實 16:9 比例 */
  display: block;
}

.exterior-content {
  position: absolute; /* 將文字視窗變成絕對定位疊加在右側預留的空位 */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  padding: 0 5%;
  display: flex;
  justify-content: flex-end; /* 推向右側 */
  align-items: center; /* 垂直居中 */
  pointer-events: none; /* 讓點擊穿透 */
}

.exterior-text-box {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  justify-content: center; /* 置中文字 */
  align-items: center; /* 改為置中對齊，讓標語與內文對齊設計稿 */
  gap: 20px;
  width: 38%; /* 完美貼合右側空位 */
  max-width: 500px;
  padding: 40px 20px;
  z-index: 10;
}

.exterior-trophy-badge {
  /* 桌機版維持容器，不影響排版 */
  align-self: flex-end;
  margin-top: -40px;
}

.exterior-trophy {
  max-width: 65px; /* 縮小獎盃尺寸 */
  height: auto;
  display: block;
}

.exterior-slogan {
  width: 100%;
  max-width: 340px; /* 大幅縮小標語尺寸 */
  height: auto;
}

.exterior-desc {
  width: 100%;
  max-width: 320px; /* 大幅縮小內文尺寸 */
  height: auto;
  margin-top: 5px;
}

.exterior-bottom-decor {
  position: absolute;
  bottom: -115px; /* 將南部彩繪山脈大幅往下移動 */
  left: 0;
  width: 100%;
  z-index: 15; /* 強制壓在所有內容上方，形成遮罩邊界 */
  pointer-events: none;
  line-height: 0;
}

.colored-mountain {
  width: 100%;
  height: auto;
  display: block;
}

/* Exterior Mobile RWD */
@media (max-width: 768px) {
  .exterior-section {
    margin-top: -60px; /* 減少疊加，適應手機端 */
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .exterior-bg-wrapper {
    position: relative; /* 手機版將圖片變為頂部堆疊塊 */
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; /* 手機版建築比例 */
    overflow: visible;
    z-index: 10;
  }

  .exterior-bg {
    height: 100%;
    width: 100%;
    object-fit: cover;
  }

  .exterior-content {
    position: relative;
    width: 100%;
    height: auto;
    min-height: auto;
    padding: 60px 20px 140px;
    background-color: #f3f0eb; /* 依照設計稿套用米色底 */
    justify-content: center;
    pointer-events: auto;
    z-index: 5;
  }

  .exterior-text-box {
    width: 100%;
    align-items: center; /* 手機版文字置中 */
    padding: 0;
    background: transparent;
    gap: 30px;
  }

  /* 手機版隱藏獎盃標籤 */
  .exterior-trophy-badge {
    display: none;
  }

  .exterior-slogan {
    max-width: 85%;
  }

  .exterior-desc {
    max-width: 95%;
  }

  .exterior-bottom-decor {
    bottom: -30px; /* 手機版將裝飾山脈往上移一點，減少與下一區塊的過大空隙 */
  }
}
