* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  height: 100%;
  font-family: "Segoe UI", "Noto Sans TC", sans-serif;
  background-color: #000;
}

.container {
  display: flex;
  flex-direction: row;
  height: 100vh;
}

.half {
  flex: 1;
  position: relative;
  color: white;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  transition: 0.3s;
}

.half::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-size: contain; /* 右邊使用 contain */
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.4);
  z-index: 1;
  transform: scale(1); /* 初始縮放 */
  transition: filter 0.3s, transform 0.3s; /* 平滑動畫 */
}

.half:hover::before {
  filter: brightness(0.78);
  transform: scale(1.1); /* 放大效果 */
}

/* 左邊影片背景 */
.half.left .background-video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover; /* 模擬 background-size: cover */
  object-position: center; /* 模擬 background-position: center */
  filter: brightness(0.4);
  z-index: 1;
  transition: filter 0.3s;
}

.half.left:hover .background-video {
  filter: brightness(0.6); /* 懸停效果 */
}

.content {
  position: relative;
  z-index: 2;
  max-width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.school-name {
  position: absolute;
  top: 0;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.school-name img {
  max-width: 470px; /* 控制 LOGO 最大寬度 */
  height: auto; /* 保持圖片比例 */
  margin-bottom: 5px; /* LOGO 和文字之間的間距 */
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.5)); /* 陰影效果 */
  margin-right: 45px;
}

.school-name .campus-text {
  font-size: 30px;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  margin-top: -46px;
}

.middle-content {
  margin-top: 150px; /* 為 school-name 預留空間 */
  margin-bottom: 0px; /* 為按鈕預留空間 */
  height: auto; /* 自適應內容 */
  min-height: 260px; /* 原本的高度 */
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* 從頂部開始排列 */
  align-items: center;
  width: 100%;
}

.content h1 {
  font-size: 2.4rem;
  margin-top: 15px; /* 確保網站名稱對齊 */
  margin-bottom: 10px;
}

.content p {
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 600px;
  min-height: 240px; /* 左邊最小高度，保留原本設置 */
  max-height: none; /* 完整顯示 */
  overflow: visible; /* 自然換行 */
  padding-top: 10px; /* 填充左邊空間 */
}

.content a {
  position: absolute;
  bottom: 0;
  padding: 12px 80px; /* 稍寬的按鈕 */
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #fff;
  border-radius: 6px;
  color: white;
  text-decoration: none;
  transition: background 0.3s;
}

.content a:hover {
  background: #111;
}

.right .school-name .campus-text,
.right .content p {
  color: #f0f0f0; /* 淺灰白 */
  text-shadow: 2px 2px 3px rgba(0,0,0,0.7); /* 增強陰影 */
}

/* 右邊背景圖片 */
.right::before {
  background-image: url('../img/iacuc_white_background.png');
  background-color: #ffffff;
  opacity: 1; /* 可加一點透明度讓下層可能露出來一點 */

}

footer {
  position: absolute;
  bottom: 10px;
  width: 100%;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  z-index: 2;
}
@media (min-width: 768px) and (max-width: 991px) {
  .school-name img {
    max-width: 400px; /* LOGO縮小一點，原本470px */
  }
  
  .school-name .campus-text {
    font-size: 26px; /* 校區文字小一點，原本30px */
    margin-top: -38px; /* 微調位置 */
  }

  .content h1 {
    font-size: 2rem; /* 標題縮小，原本2.4rem */
    margin-top: 10px;
    margin-bottom: 8px;
  }

  .content p {
    font-size: 1rem; /* 內文字體也小一點點 */
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    height: auto;
  }
  .half {
    height: auto; /* 適應內容 */
    min-height: 50vh; /* 確保最小高度 */
  }
  .school-name img {
    max-width: 300px;
    margin-bottom: 0px; /* LOGO 和文字之間的間距 */

  }
  .school-name .campus-text {
    font-size: 1.5rem;
    margin-top: -26px;
  }
  .middle-content {
    margin-top: 100px;
    margin-bottom: 80px;
    height: auto; /* 自適應內容 */
    min-height: 200px; /* 最小高度 */
  }
  .content h1 {
    font-size: 1.5rem;
    margin-top: 10px;
    margin-bottom: 8px;
  }
  .content p {
    min-height: 160px; /* 左邊最小高度 */
    max-height: none; /* 完整顯示 */
    padding-top: 8px;
  }
  .content a {
    padding: 10px 80px; /* 手機端稍寬 */
    margin-bottom: 10px;
  }
  /* 手機端禁用右邊放大動畫 */
  .half:hover::before {
    transform: scale(1); /* 保持原大小 */
  }
}


    /* 無障礙樣式補充 */
    .skip-link {
      position: absolute;
      top: -40px;
      left: 0;
      background: #000;
      color: #fff;
      padding: 8px;
      z-index: 100;
      transition: top 0.3s;
    }
    .skip-link:focus {
      top: 0;
    }
    .content a:focus {
      outline: 2px solid #fff;
      outline-offset: 2px;
      background: #111; /* 與 :hover 一致 */
    }
    .video-controls {
      position: absolute;
      bottom: 60px;
      z-index: 2;
      background: rgba(0, 0, 0, 0.7);
      border-radius: 4px;
    }
    .video-controls button {
      padding: 8px 12px;
      color: #fff;
      background: none;
      border: 1px solid #fff;
      border-radius: 4px;
      cursor: pointer;
      transition: background 0.3s;
    }
    .video-controls button:hover,
    .video-controls button:focus {
      background: #111;
      outline: 2px solid #fff;
      outline-offset: 2px;
    }
    /* 確保文字對比度（假設 main.css 未完全定義） */
    .content h1, .content p, .school-name .campus-text {
      color: #fff; /* 確保高對比 */
      text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    }
    /* 手機端調整 */
    @media (max-width: 768px) {
      .video-controls {
        bottom: 80px;
      }
    }