body {
  background-image: url('/圖片/IMG_1606.JPG');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.camera-card {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to right, rgba(0, 51, 102, 0.548), rgba(0, 136, 204, 0.425));
  backdrop-filter: blur(20px);
  padding: 1rem 2rem;
  position: fixed;
  top: 0;
  left: 0; /* 👈 這行非常關鍵！ */
  width: 100vw; /* ✅ 改成 100vw 避免受限父元素 */
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.404);
  margin: 0;
}


nav .nav-left img {
      height: 50px;
    }
    nav .nav-right a {
      color: white;
      text-decoration: none;
      margin-left: 1.5rem;
      font-weight: bold;
      font-size: 1rem;
      transition: color 0.3s;
    }
    nav .nav-right a:hover {
      color: #63e6be;
    }
    .overlay {
      background: rgba(0, 0, 0, 0.5);
      padding: 2rem;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
    /* 左邊 logo 圖片 */
.nav-left .logo {
  height: 50px;
  display: block;
}

/* 右邊連結排列 */
.nav-right {
  display: flex;
  align-items: center;
}
    /* 內部容器，控制左右排列與寬度 */
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  padding: 0 2rem; /* 加入左右內距 */
  margin-left: 0;  /* ✅ 靠左 */
  margin-right: auto;
}
/* 導覽列固定在上方 */
.main-navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: rgba(10, 109, 202, 0.7);
  padding: 0.2rem 1.5rem;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
body {
  padding-top: 50px; /* 或者視實際導覽高度調整 */
}

/* ========== 即時影像樣式區塊 ========== */
.camera-card {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  padding: 2rem;
  border-radius: 1.5rem;
  margin: 2rem auto;
  width: 95%;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.camera-card h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.video-grid iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 1rem;
  border: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
/* 響應式設計優化 */
.camera-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 1.25rem;
  margin: 1.5rem auto;
  width: 95%;
  max-width: 1100px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.video-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: 1fr;
}

/* 平板（大於 600px） */
@media (min-width: 600px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 桌機（大於 1024px） */
@media (min-width: 1024px) {
  .camera-card {
    padding: 2rem 2.5rem;
  }
  .video-grid {
    gap: 1.5rem;
  }
}
/** 訪問人數顯示區塊 - 藥丸樣式 */
#visitor-count {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  margin: 2rem auto 2.5rem auto;
  text-align: center;
  animation: fadeIn 1s ease-out;
}

#visitor-count:hover {
  background: rgba(0, 0, 0, 0.6);
  transform: scale(1.05);
  transition: all 0.3s ease;
}

/* 主視覺區塊 */
.hero-section {
  text-align: center;
  padding: 3rem 1rem 2rem 1rem;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.884), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  margin: 1.5rem auto;
  max-width: 720px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.315);
}


.hero-section h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.719);
  margin-bottom: 0.8rem;
}

.hero-section .subtitle {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #f1f1f1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.884);
}

/* RWD 適配 */
@media (max-width: 768px) {
  .hero-section {
    padding: 5rem 1.5rem 2rem 1.5rem;
  }

  .hero-section h1 {
    font-size: 2rem;
  }

  .hero-section .subtitle {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-section h1 {
    font-size: 1.6rem;
  }

  .hero-section .subtitle {
    font-size: 0.95rem;
  }
}
.video-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center; /* 影片置中 */
}
.video-grid iframe {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
}
.camera-card {
  margin: 1rem auto;
  padding: 1rem;
  width: 95%; /* 手機小寬度時更窄 */
  max-width: 100%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
}
.hero-section {
  margin: 1.5rem auto;
  padding: 1.5rem 1rem;
  width: 90%;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border-radius: 1rem;
}
@media (min-width: 768px) {
  .video-grid {
    flex-direction: row;
    justify-content: center;
  }
  .video-grid iframe {
    width: 45%;
  }

  .camera-card {
    width: 80%;
  }

  .hero-section {
    width: 60%;
  }
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* 防止橫向滾動 */
}

@media (max-width: 580px) {
  nav .nav-right a {
    font-size: 1rem; /* 原本是 1rem，這裡變小 */
    margin-left: 1rem;  /* 如果太擠也可以再小一點 */
  }

  nav .nav-left img,
  .nav-left .logo {
    height: 40px; /* Logo 也可以稍微變小 */
  }
}
