/* header / brand */
.header-inner{display:flex;align-items:center;justify-content:space-between;gap:20px}
/* 品牌區域：徽章在左，文字在右上下排列 */
.brand-link{display:flex;align-items:center;gap:14px; flex-shrink:0; min-width:300px; text-decoration:none; color:inherit}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-stack {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.brand-text h1{margin:0;font-size:18px;line-height:1.05}
.brand-text .tagline{margin:4px 0 0;font-size:12px;color:rgba(230,238,248,0.78)}

/* 校徽（縮小） */
.ntu-seal{
  width:48px;
  height:48px;
  object-fit:cover;
  border-radius:6px;
  padding:4px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 6px 18px rgba(2,8,25,0.45);
  transition: transform 220ms ease, box-shadow 220ms ease;
  flex-shrink:0;
}

/* nav */
.main-nav ul{
  display:flex;
  list-style:none;
  padding:0;
  margin:0;
  gap:18px;
  flex-wrap: nowrap; /* 保留：防止項目換行 */
  justify-content: space-between; /* 保留：均分空間，適應長文字 */
}
.main-nav a{
  color:rgba(230,238,248,0.9);
  text-decoration:none;
  font-weight:600;
  padding:8px 12px;
  border-radius:8px;
  transition:all 240ms var(--ease);
  /* 移除 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 以允許換行 */
}
.main-nav a:hover{background:rgba(255,255,255,0.04); transform:translateY(-3px)}

/* 修改：針對英文版的調整，允許文字換行但限制為兩行 */
.lang-en .main-nav a {
  font-size: 13px; /* 英文版字體稍小 */
  letter-spacing: 0.5px; /* 增加字母間距以改善可讀性 */
  white-space: normal; /* 允許換行 */
  display: -webkit-box; /* 使用flexbox-like行為 */
  -webkit-line-clamp: 2; /* 限制為兩行 */
  -webkit-box-orient: vertical; /* 垂直方向 */
  overflow: hidden; /* 隱藏超出部分 */
  line-height: 1.2; /* 調整行高以適應兩行 */
}

/* 全站 header 下方分隔線（顯著且現代感） */
.site-header{
  position: relative; /* 必要以定位 ::after */
  z-index: 30;
}

/* 寬度延伸至 viewport，並在 header 下方顯示分隔線 */
.site-header::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;          /* 與 header/下方區塊保持少量間距 */
  height: 10px;          /* 加粗線條 */
  border-top: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(70,150,255,0.40) 28%,
    rgba(138,43,226,0.40) 56%,
    rgba(255,255,255,0.04) 100%);
  box-shadow: 0 14px 40px rgba(6,10,25,0.75), inset 0 1px 0 rgba(255,255,255,0.02);
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.6));
  pointer-events: none;
  z-index: 5;
}

/* 手機/窄螢幕：降低厚度但保持可見 */
@media (max-width:720px){
  .site-header::after{
    bottom: -6px;
    height: 5px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
    background: linear-gradient(90deg,
      rgba(255,255,255,0.03) 0%,
      rgba(70,150,255,0.30) 40%,
      rgba(138,43,226,0.30) 60%,
      rgba(255,255,255,0.03) 100%);
  }
}