* {
  padding: 0;
  margin: 0;
}

body {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Noto Sans TC", sans-serif;
  background-color: #e9e4db;
}

img {
  width: 100%;
  display: block;
  pointer-events: none;
}

button {
  cursor: pointer;
  border: 0;
}
button:active {
  background-color: transparent;
}

a {
  color: black;
  text-decoration: none;
}

p {
  color: black;
}
.related-button-position {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2;
}

.related-button {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  background-size: contain; /* 確保背景圖片完全顯示 */
  background-repeat: no-repeat; /* 不重複背景圖片 */
  overflow: visible;
  width: 140px;
  height: 140px;
  background-color: transparent;
  background-image: url("../images/icon/related-links-1024.png");
}

.related-button:hover {
  background-image: url("../images/icon/related-links-hover-1024.png");
}

.related-window-overlay {
  display: none;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 100px 30px;
  box-sizing: border-box;
  z-index: 2;
}
.related-window-overlay.show {
  display: block;
  animation: window-block 0.5s ease forwards;
}

.related-window-position {
  display: flex;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.related-window {
  max-width: 80em;
  width: 100%;
  height: 100%;
  background-color: #f0f0f0;
  border-radius: 40px;
  padding: 40px 5px 40px 40px;
  box-sizing: border-box;
}

.related-window-overflow {
  height: 88%;
  overflow-y: auto;
  padding: 0px 35px 0px 0px;
}

.related-window-top {
  display: flex;
  justify-content: space-between;
  padding-bottom: 20px;
  margin-right: 40px;
  margin-bottom: 5px;
  border-bottom: 2px solid var(--main-orange);
}

.related-window-top-title {
  color: var(--main-orange);
  font-size: var(--window-title-text);
  font-weight: 900;
}

.related-window-top-button {
  width: 36px;
  height: 36px;
  padding: 6px;
  background-color: transparent;
  border-radius: 50%;
}

.related-window-center {
  padding: 35px 0px 40px 0px;
}

.related-window-center-title {
  width: 280px;
}

.related-window-center-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #e4e4e4;
  padding: 12px 20px 20px 20px;
  gap: 12px;
  align-self: stretch;
}

.related-window-center-button {
  display: flex;
  justify-content: center;
  align-items: center;
  color: black;
  width: 100%;
  height: 60px;
  padding: 0px 12px;
  flex-direction: column;
  border-radius: 12px;
  background: white;
  box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.1);
  text-align: center;
  white-space: pre-line;
  font-size: var(--window-content-text);
  font-weight: 400;
  cursor: pointer;
}

.related-window-center-button:hover {
  box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.2);
}

.related-window-bottom {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0px 20px;
  align-items: flex-start;
  align-content: flex-start;
  gap: 20px 12px;
  align-self: stretch;
}
.related-window-bottom-card {
  width: 100%;
  height: 100px;
  padding: 12px;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.1);
  background-position: center;
  background-repeat: no-repeat;
}

.related-window-bottom-card:hover {
  box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.2);
}
.card-logo-01 {
  background-image: url("../images/logo/windows-card-logo-01.png");
}
.card-logo-02 {
  background-image: url("../images/logo/windows-card-logo-02.png");
}
.card-logo-03 {
  background-image: url("../images/logo/windows-card-logo-03.png");
}
.card-logo-04 {
  background-image: url("../images/logo/windows-card-logo-04.png");
}
.card-logo-05 {
  background-image: url("../images/logo/windows-card-logo-05.png");
}
.card-logo-06 {
  background-image: url("../images/logo/windows-card-logo-06.png");
}

.inspection-process {
  position: relative;
  overflow: hidden;
}

.trigger-point {
  position: absolute;
  top: 9.5%;
  width: 100%;
  height: 5px;
}

.animation-car {
  position: absolute;
  width: 29.4%;
  top: 1.8%;
  right: -30%;
  animation: carmove 7s cubic-bezier(0.1, 0.5, 0.8, 1) forwards paused,
    shock 0.2s infinite alternate;
}

.play-animation {
  animation-play-state: running;
}

.img-part-2 {
  display: none;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 40px 100px;
  background-color: #f3eee2;
}

.footer-left {
  display: flex;
  justify-content: space-between;
  width: 740px;
  font-size: var(--footer-text);
  margin-right: 20px;
}

.footer-right {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.footer-left-text-top {
  margin-bottom: 8px;
  white-space: nowrap;
}

.footer-left-text-bottom {
  display: flex;
  line-height: 120%;
  white-space: nowrap;
}

.footer-left-text-bottom-left {
  padding-right: 10px;
  border-right: 1px solid black;
}

.footer-left-text-bottom-right {
  padding-left: 10px;
}

.footer-logo {
  max-width: 20em;
  max-height: 3.25em;
}

:root {
  --related-link-text: 28px;
  --window-title-text: 32px;
  --window-content-text: 16px;
  --footer-text: 16px;
  --main-orange: #dd8e3a;
}

@keyframes carmove {
  0% {
    right: -30%;
  }
  100% {
    right: 4%;
  }
}

@keyframes shock {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(0.6px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes window-block {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* 捲軸寬度及高度 */
::-webkit-scrollbar {
  width: 5px; /*右側捲軸寬度*/
  height: 5px; /*下方捲軸高度*/
}
/* 軌道背景底色 */
::-webkit-scrollbar-track {
  background: #f0f0f0;
}

/* 滑桿顏色 */
::-webkit-scrollbar-thumb {
  background: #a5a5a5;
  border-radius: 10px;
  min-height: 20px;
}

/* 電腦版面 */
@media (max-width: 1439px) {
  .animation-car {
    top: 3.5%;
  }
}
/* 平板彈窗內容排列換版 */
@media (max-width: 1320px) {
  /* 修正彈窗內滾動條造成的跑版 */
  .related-window-center-content {
    grid-template-columns: repeat(3, 1fr);
    padding: 12px 15px 20px 20px;
  }
  .related-window-bottom {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* 平板footer提早換版 */
@media (max-width: 1090px) {
  footer {
    flex-direction: column;
    padding: 40px;
  }
  .footer-left {
    width: 100%;
    display: flex;
  }
  .footer-right {
    margin-top: 20px;
    justify-content: end;
  }
  :root {
    --footer-text: 14px;
  }
}

/* 平板版面1024 */
@media (max-width: 1024px) {
  .related-button {
    background-image: url("../images/icon/related-links-768.png");
    width: 120px;
    height: 120px;
  }
  .related-button:hover {
    background-image: url("../images/icon/related-links-hover-768.png");
  }
  .related-window {
    max-width: 41.75em;
  }
  .related-window-overlay {
    padding: 100px 0px;
  }
  .related-window-center-button {
    height: 60px;
  }
  .related-window-bottom-card {
    height: 76px;
  }
  /* 修正彈窗內滾動條造成的跑版 */
  .related-window-center-content {
    grid-template-columns: repeat(2, 1fr);
  }
  .related-window-bottom {
    grid-template-columns: repeat(2, 1fr);
  }
  .related-window-bottom-card {
    height: 100px;
    align-items: flex-start;
    gap: 20px;
  }
  :root {
    --related-link-text: 24px;
  }
}
@media (max-width: 1023px) {
  .trigger-point {
    top: 22.5%;
  }
  .animation-car {
    width: 54%;
    right: -70%;
    top: 16.6%;
  }
  @keyframes carmove {
    0% {
      right: -70%;
    }
    100% {
      right: 4%;
    }
  }
}

/* 手機版面768 */
@media (max-width: 767px) {
  body.no-scroll {
    /* 隱藏滾動 */
    overflow: hidden;
  }
  .related-button-position {
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
  }
  /* 添加新的透明度類別，用於過度按鈕 */
  .related-button-position.fade-out {
    opacity: 0;
  }
  .related-button-position.bottom {
    top: auto;
    bottom: 120px;
  }
  .related-button {
    background-image: url("../images/icon/related-links-540.png");
    width: 100px;
    height: 100px;
  }
  .related-button:hover {
    background-image: url("../images/icon/related-links-hover-540.png");
  }
  .animation-car {
    width: 56%;
    right: -70%;
    top: 13.6%;
  }
  .related-window-overlay {
    padding: 0;
    z-index: 2;
  }
  .related-window {
    position: fixed;
    z-index: 3;
    max-width: none;
    border-radius: 0px;
    padding: 20px 5px 20px 20px;
  }
  .related-window-overflow {
    height: 90%;
    padding: 0px 15px 0px 0px;
  }
  .related-window-top {
    padding-bottom: 8px;
    margin-right: 15px;
  }
  .related-window-center-content {
    grid-template-columns: repeat(1, 1fr);
    padding: 12px 20px 20px 20px;
    align-items: flex-start;
    gap: 8px;
  }
  .related-window-bottom {
    grid-template-columns: repeat(1, 1fr);
  }
  .related-window-center {
    padding: 20px 0px;
  }
  .related-window-center-title {
    width: 170px;
  }
  .related-window-bottom {
    gap: 8px;
  }
  .related-window-bottom-card {
    width: 100%;
    height: 60px;
    padding: 4px 12px;
    border-radius: 12px;
  }
  .card-logo-01 {
    background-image: url("../images/logo/windows-card-logo-01-mobile.png");
  }
  .card-logo-02 {
    background-image: url("../images/logo/windows-card-logo-02-mobile.png");
  }
  .card-logo-03 {
    background-image: url("../images/logo/windows-card-logo-03-mobile.png");
  }
  .card-logo-04 {
    background-image: url("../images/logo/windows-card-logo-04-mobile.png");
  }
  .card-logo-05 {
    background-image: url("../images/logo/windows-card-logo-05-mobile.png");
  }
  .card-logo-06 {
    background-image: url("../images/logo/windows-card-logo-06-mobile.png");
  }
  .trigger-point {
    top: 17.8%;
  }

  footer {
    align-items: center;
    padding: 40px 20px;
  }
  .footer-left {
    width: auto;
    flex-direction: column-reverse;
    display: flex;
  }
  .footer-right {
    margin-top: 0px;
  }
  .footer-logo {
    margin: 20px 0px 8px 0px;
  }
  :root {
    --related-link-text: 18px;
    --window-title-text: 24px;
  }
  @keyframes carmove {
    0% {
      right: -70%;
    }
    100% {
      right: 1%;
    }
  }
}
/* 手機版面540 */
@media (max-width: 539px) {
  .animation-car {
    width: 68%;
    top: 14.2%;
  }
  .img-part-2 {
    display: block;
  }
  .related-button {
    background-image: url("../images/icon/related-links-375.png");
    width: 80px;
    height: 80px;
  }
  .related-button:hover {
    background-image: url("../images/icon/related-links-hover-375.png");
  }
  :root {
    --related-link-text: 16px;
  }
  .related-button-position {
    top: 12px;
    right: 12px;
  }
  .related-button-position.bottom {
    top: auto;
    bottom: 92px;
  }
}
/* 超小手機板375(對應蘋果SE) */
@media (max-width: 374px) {
  footer {
    padding: 30px 10px;
  }
}

/* 手機橫向模式 */
@media (max-width: 1024px) and (orientation: landscape) {
  /* 隱藏滾動條 */
  body.no-scroll {
    overflow: hidden;
  }
  .related-button {
    background-image: url("../images/icon/related-links-540.png");
    width: 100px;
    height: 100px;
  }
  .related-button:hover {
    background-image: url("../images/icon/related-links-hover-540.png");
  }
  .related-window-overlay {
    padding: 0;
    z-index: 2;
    overflow: hidden;
  }

  .related-window {
    position: fixed;
    z-index: 3;
    max-width: none;
    border-radius: 0px;
    padding: 20px 5px 20px 20px;
    overflow: hidden;
  }

  .related-window-overflow {
    height: 82%;
    padding: 0px 15px 0px 0px;
    overflow-y: auto;
  }

  /* 其他設定保持不變... */
  .related-window-center-content {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-window-bottom {
    grid-template-columns: repeat(2, 1fr);
  } 
}
