/* 通用選擇器，針對所有 HTML 元素 */
* {
  font-size: clamp(16px, 2vw, 20px);
}

img {
  width: 100%;
  max-width: 400px;
  height: auto;
}


/* 滑鼠指向 <summary> 時變紅 */
summary:hover {
  color: red;
  cursor: pointer;
}

/* 滑鼠指向 <a> 超連結時變紅 */
a:hover {
  color: red;
  text-decoration: underline;
}

/* 選單基本樣式 */
ul {
  list-style-type: none;
  padding: 10;
  margin: 10;
  justify-content: center;
}

li {
  margin-right: 20px;
}

a {
  text-decoration: none;
  color: #333;
}

.header-menu {
  display: grid; /* 使用 grid 布局 */
  grid-template-columns: repeat(7, 1fr); /* 每行 7 列 */
  gap: 10px; /* 項目之間的間距 */
}

.header-menu li {
  text-align: center; /* 讓文字居中 */
}

/* 資料表格樣式 */
.row {
  display: flex;
  margin-bottom: 20px;
  border: 1px solid #000;
}

.col {
  flex: 1;
  padding: 10px;
  border-right: 1px solid #000;
  text-align: center;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

summary.centered {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 📱 手機版：展開選單可滾動 */
@media screen and (max-width: 992px) {
  #navItems {
    max-height: 70vh;
    overflow-y: auto;
  }
}

/* 💻 平板與桌機版：統一字型與間距（選擇性） */
@media screen and (min-width: 601px) {
  .col {
    font-size: 16px;
    padding: 10px;
  }
}

@media screen and (min-width: 993px) {
  .col {
    font-size: 18px;
    padding: 12px;
  }

  /* 桌機版選單項目微調 */
  .navbar-nav li {
    flex: 0 1 auto;
  }
}

/* 最後一欄不要右邊線 */
.col:last-child {
  border-right: none;
}


.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 每行 4 張卡片 */
  gap: 16px; /* 卡片之間的間距 */
  padding: 20px;
}

.card {
  border: 1px solid #aaa;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  box-sizing: border-box;
}

/* 📱 手機版展開選單可滾動 */
@media screen and (max-width: 992px) {
  #navItems {
    max-height: 70vh;
    overflow-y: auto;
  }
}

/* 🖥️ 桌機選單排版微調 */
@media screen and (min-width: 993px) {
  .navbar-nav li {
    flex: 0 1 auto;
  }
}

@media screen and (max-width: 600px) {
  .header-menu {
    grid-template-columns: repeat(3, 1fr); /* 小屏幕每行顯示 3 列 */
  }
}

@media screen and (max-width: 992px) {
  .header-menu {
    grid-template-columns: repeat(4, 1fr); /* 中等屏幕每行顯示 4 列 */
  }
}