[v-cloak] {
  display: none !important;
}

/* 全局樣式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  --primary-color: #2C2C61;
  /* 主色(深藍紫) */
  --accent-color: #F07368;
  /* 強調色(珊瑚紅) */
  --text-color-base: #333;
  /* 文字-基礎 */
  --text-color-muted: #666;
  /* 文字-次要(灰色) */
  --bgl: #F8F9FA;
  /* 背景-淺色 (如 section) */
  --bgw: #FFF;
  /* 背景-白色 */
  --bdl: #F4F4F4;
  /* 邊框-淺色 */
}

body {
  font-family: 'Noto Sans TC', sans-serif;
  line-height: 1.6;
  color: var(--primary-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #FFF;
  overflow-x: clip;
  /* 防止橫向卷軸且保留 position: sticky 運作 */
}

/* 頂部信息欄樣式 */
.top-bar {
  background-color: var(--primary-color);
  color: #FFF;
  /* padding: 0.5rem 0; */
  position: fixed;
  width: 100%;
  top: 0;
  min-height: 42px;
  z-index: 1001;
  /* 確保在 header 之上 */
}

.top-bar-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* padding: 0 2rem; */
  padding-left: 1rem;
  min-height: 42px;
}

.contact-info {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

.contact-info span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-info i {
  font-size: 1rem;
  width: 16px;
  text-align: center;
  color: var(--accent-color);
}

.top-bar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-bar-user .login-logout {
  background-color: var(--accent-color);
  color: var(--primary-color);
  border: 2px solid var(--accent-color);
  padding: 0 1.5rem 0 2rem;
  transition: all 0.3s ease;
  height: 42px;
  /* 與 top-bar 高度一致 */
  font-weight: bold;
  cursor: pointer;
  font-size: 0.9rem;
  letter-spacing: 8px;
  /* 增加字距 */
}

.top-bar-user .login-logout:hover {
  background-color: var(--primary-color);
  color: #FFF;
  border: 2px solid var(--accent-color);
}

.login-btn {
  margin-left: auto;
}

.login-btn button {
  background-color: var(--primary-color);
  color: #FFF;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(44, 44, 97, 0.1);
}

.login-btn button:hover {
  background-color: #3B3397;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(44, 44, 97, 0.2);
}

/* 頁首樣式 */
header {
  background-color: #FFF;
  padding: 0 2rem;
  position: fixed;
  width: 100%;
  top: 42px;
  /* 頂部信息欄的高度 */
  z-index: 1000;
  display: flex;
  align-items: center;
  height: 80px;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
}

.logo a {
  display: block;
  text-decoration: none;
}

.logo img {
  height: 60px;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

/* 漢堡選單按鈕樣式 */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-color);
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1002;
}

/* 導航欄樣式 */
.main-nav {
  background-color: transparent;
  position: static;
  width: auto;
  padding: 0;
  box-shadow: none;
  border-bottom: none;
  /* 將導航欄推到右側 */
  /* margin-left: auto; */
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  /* 將導航項目靠右對齊 */
  /* justify-content: flex-end; */
}

.main-nav .nav-link {
  text-decoration: none;
  font-size: 0.95rem;
  color: #021949;
  /* padding: 0.4rem 1rem; */
  transition: all 0.3s ease;
  border-radius: 4px;
  opacity: 0.8;
  position: relative;
  display: inline-block;
}

.main-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: width 0.3s ease;
  /* 動畫效果作用於寬度 */
  transform: translateX(-50%);
  bottom: -4px;
  /* 與文字保持間距 */
}

.main-nav .nav-link:hover {
  color: var(--accent-color);
  opacity: 1;
}

.main-nav .nav-link:hover::after {
  width: 120%;
}

.nav-subtitle {
  font-size: 0.8rem;
  opacity: 0.7;
  display: block;
  margin-top: 2px;
}

/* 頁面容器統一樣式 */
.page-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  margin-top: 1rem;
}

.page-container.grid,
.page-container:has(> .sub-nav) {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

/* 內容區域統一樣式 */
.content {
  background-color: #FFF;
  padding: 3rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--bdl);
  width: 100%;
  min-width: 0;
}

/* 側邊導航統一樣式 */
.sub-nav {
  background-color: #FFF;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 144px;
  align-self: start;
  height: fit-content;
  border: 1px solid var(--bdl);
  width: 300px;
}

.sub-nav h2 {
  color: var(--primary-color);
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
  font-size: 1.2rem;
}

.sub-nav ul {
  list-style: none;
  padding: 0;
}

.sub-nav li {
  margin-bottom: 0.8rem;
}

.sub-nav a {
  color: #666;
  text-decoration: none;
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.sub-nav a:hover {
  background-color: var(--bdl);
  color: var(--primary-color);
}

.sub-nav a.active {
  background-color: var(--accent-color);
  color: #FFF;
}

/* 時間軸樣式 */
.timeline {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.timeline-item {
  background-color: #FFF;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.timeline-item:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.timeline-item h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

/* 特色卡片樣式 */
.features {
  max-width: 1200px;
  margin: 0 auto 3rem;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  background-color: #FFF;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid var(--bdl);
}

.feature-card:hover {
  transform: translateY(-5px);
  background-color: var(--primary-color);
  color: #FFF;
  box-shadow: 0 4px 12px rgba(44, 44, 97, 0.1);
}

.feature-card h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.feature-card:hover h2 {
  color: #FFF;
}

/* 頁尾樣式 */
footer {
  background-color: var(--primary-color);
  color: #FFF;
  padding: 4rem 0 0;
  margin-top: 0;
  width: 100%;
  position: relative;
  z-index: 2;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-section h3 {
  color: #FFF;
  font-size: 1.2rem;
  margin-bottom: 1.2rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-section h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: var(--accent-color);
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 0.6rem;
}

.footer-section ul li a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}

.footer-section ul li a:hover {
  color: var(--accent-color);
  transform: translateX(5px);
}

.footer-section ul li i {
  margin-right: 0.5rem;
  color: var(--accent-color);
  width: 16px;
  text-align: center;
}

.footer-bottom {
  margin-top: 2rem;
  padding: 1.5rem 0;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

/* 主要內容區域樣式 */
main {
  flex: 1 0 auto;
  padding-top: 122px;
  /* 頂部信息欄(42px) + header(80px) */
  width: 100%;
  overflow-x: clip;
  /* 防止橫向卷軸且保留 position: sticky 運作 */
}

/* Banner 區域樣式 */
.banner {
  position: relative;
  width: 100%;
  height: 700px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: 0;
  overflow: hidden;
}

.banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom,
      rgba(44, 44, 97, 0.7),
      rgba(44, 44, 97, 0.5));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.banner-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #FFF;
}

.banner-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.banner-content p {
  font-size: 1.2rem;
  max-width: 600px;
  line-height: 1.6;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* 最新消息區塊樣式 */
.news-section {
  padding: 4rem 0;
  background-color: var(--bgl);
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  width: 100%;
  margin-top: 0;
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

.section-title {
  text-align: center;
  color: var(--primary-color);
  font-size: 2rem;
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--accent-color);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.news-card {
  transition: all 0.3s ease;
  overflow: hidden;
  background: #FFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  border: 1px solid var(--bdl);
  /* 從 .news-page 版本加入 */
  /* padding: 1.5rem; */
  display: flex;
  /* 使用 flexbox 進行卡片佈局 */
  flex-direction: column;
  /* 垂直堆疊內容 */
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.news-date {
  display: inline-block;
  background: var(--primary-color);
  color: #FFF;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.news-content {
  padding: 1.5rem;
  /* 在這裡應用內邊距 */
  flex-grow: 1;
  /* 允許內容區佔用可用空間 */
  /* display: flex;
  flex-direction: column; */
}

.news-content h3 {
  color: var(--primary-color);
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.news-content p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  /* 允許段落填充按鈕之前的空間 */
}

.news-excerpt {
  font-size: 0.95rem;
  /* 摘要的字體稍小 */
  margin-bottom: 1rem;
  /* 如果需要，調整下邊距 */

  /* 多行省略樣式 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  /* 【重要】設定您期望的行數 (例如: 3) */
  overflow: hidden;
  text-overflow: ellipsis;
  /* 確保截斷行有足夠的高度 (可選但建議) */
  /* 如果實際行高不同，請調整 1.6 */
  /* max-height: calc(1.6em * 3); */
}

.read-more {
  color: var(--accent-color);
  display: inline-block;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  /* 使用 inline-flex 以便對齊圖標 */
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  /* 如果卡片高度不一致，將連結推到底部 */
  align-self: flex-start;
  /* 將連結左對齊 */
}

.read-more:hover {
  color: var(--primary-color);
  gap: 0.8rem;
  /* hover 時增加間距 */
}

.read-more i {
  /* 潛在圖標的樣式 */
  font-size: 0.9rem;
  transition: transform 0.3s ease;
}

.read-more:hover i {
  transform: translateX(3px);
}

/* 主計畫介紹區塊樣式 */
.project-intro {
  padding: 4rem 0;
  background-color: #FFF;
  position: relative;
  z-index: 1;
}

.project-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.project-text p {
  color: #666;
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.project-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-item {
  padding: 2rem;
  background-color: var(--bgl);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #666;
  font-size: 1rem;
}

/* 子計畫介紹區塊樣式 */
.sub-projects {
  padding: 4rem 0;
  background-color: var(--bgl);
  position: relative;
  z-index: 1;
}

.sub-projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.sub-project-card {
  background: #FFF;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  text-align: center;
}

.sub-project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sub-project-icon {
  width: 80px;
  height: 80px;
  background-color: var(--bgl);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  position: relative;
}

.sub-project-icon i {
  font-size: 2rem;
  color: var(--primary-color);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sub-project-card h3 {
  color: var(--primary-color);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  text-align: center;
}

.sub-project-card p {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  text-align: justify;
}

/* 回到頂部按鈕樣式 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: #FFF;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--accent-color);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.back-to-top i {
  transition: transform 0.3s ease;
}

.back-to-top:hover i {
  transform: translateY(-2px);
}


/* 響應式設計 */
@media (max-width: 992px) {
  .page-container.grid,
  .page-container:has(> .sub-nav) {
    grid-template-columns: minmax(0, 1fr);
  }

  .sub-nav {
    position: static;
    width: 100%;
    margin-bottom: 0;
  }
}

@media (max-width: 980px) {
  .main-nav .nav-link {
    width: 2.4rem;
  }
}

@media (max-width: 768px) {
  .top-bar {
    position: fixed;
    width: 100%;
    z-index: 1001;
  }

  .top-bar-container {
    padding-left: 0.75rem;
    gap: 0.5rem;
  }

  .contact-info {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .contact-info span:not(:first-child) {
    display: none;
    /* 隱藏除電話外的聯絡資訊 */
  }

  .top-bar-user {
    gap: 0.5rem;
    font-size: 0.85rem;
    min-width: 0;
  }

  .top-bar-user > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-bar-user .login-logout {
    padding: 0 0.9rem 0 1.1rem;
    font-size: 0.85rem;
    letter-spacing: 4px;
    flex-shrink: 0;
  }

  header {
    top: 42px;
    padding: 0 1rem;
  }

  .logo img {
    height: 50px;
    /* 縮小 LOGO */
    width: auto;
  }

  .mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    margin-bottom: 0;
    z-index: 1002;
  }

  .main-nav {
    position: fixed;
    top: 122px;
    /* 頂部信息欄 + header 的高度 */
    left: 0;
    width: 100%;
    background-color: var(--primary-color) !important;
    /* 使用 !important 確保背景顏色 */
    padding: 2rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  .main-nav.show {
    transform: translateX(0);
  }

  .main-nav ul {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }

  .main-nav .nav-link {
    color: #FFF;
    /* 修改文字顏色 */
    font-size: 1.1rem;
    padding: 0.8rem 0;
    display: block;
    width: 100%;
    text-align: center;
    opacity: 0.9;
  }

  .main-nav .nav-link:hover {
    color: var(--accent-color);
    /* 修改懸停顏色 */
    background-color: transparent;
    opacity: 1;
  }

  .main-nav .nav-link::after {
    display: none;
  }

  .page-container {
    padding: 1rem;
  }

  .page-container.grid,
  .page-container:has(> .sub-nav) {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .content {
    padding: 2rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .features {
    grid-template-columns: 1fr;
    padding: 0 1.5rem;
    margin-bottom: 2rem;
  }

  footer {
    padding: 3rem 0 0;
    margin-top: 0;
    width: 100%;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-section {
    text-align: center;
  }

  .footer-section h3::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-section ul li a:hover {
    transform: translateX(0);
  }

  .banner {
    height: 500px;
    margin-bottom: 0;
  }

  .section-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
  }

  .project-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .project-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .sub-projects-grid {
    grid-template-columns: 1fr;
  }

  .sub-project-card {
    padding: 1.5rem;
  }

  .sub-project-icon {
    width: 60px;
    height: 60px;
  }

  .sub-project-icon i {
    font-size: 1.5rem;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr;
  }

  .news-card {
    padding: 1.2rem;
  }

  .news-date {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }
}

/* Overview 區塊樣式 */
#overview {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

#overview h2 {
  color: var(--primary-color);
  font-size: 2rem;
  margin-bottom: 2.5rem;
  text-align: left;
  position: relative;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

#overview p {
  line-height: 1.8;
  margin-bottom: 2rem;
  color: #333;
  font-size: 1.1rem;
  text-align: justify;
  padding: 0 1.5rem;
}

#overview>p:first-of-type {
  font-size: 1.2rem;
  line-height: 1.9;
  color: var(--primary-color);
  font-weight: 500;
  padding: 2rem;
  background: var(--bgl);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 3rem;
  position: relative;
  border: 1px solid #e9ecef;
}

#overview>p:first-of-type::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-color);
  border-radius: 2px;
}

#overview ul {
  list-style: none;
  padding-left: 1.5rem;
  margin-bottom: 2rem;
}

#overview ul li {
  position: relative;
  margin-bottom: 1.5rem;
  line-height: 1.8;
  color: #333;
  font-size: 1.1rem;
  text-align: justify;
}

#overview ul li:before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.8rem;
  width: 8px;
  height: 8px;
  background-color: var(--accent-color);
  border-radius: 50%;
}

@media (max-width: 768px) {
  #overview {
    padding: 1rem;
  }

  #overview h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
  }

  #overview p,
  #overview ul li {
    font-size: 1rem;
    line-height: 1.7;
    padding: 0 1rem;
  }

  #overview p:first-of-type {
    font-size: 1.1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
  }
}

/* 分頁 Banner 區域樣式 */
.page-banner {
  position: relative;
  height: 200px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 2rem;
  background-color: var(--bgl);
}

.page-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(rgba(44, 44, 97, 0.7), rgba(44, 44, 97, 0.7));
  z-index: 1;
}

.page-banner-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 2rem;
}

.page-banner-content h1 {
  color: #fff;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.2em;
}

.page-banner-content p {
  color: #fff;
  font-size: 1.2rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  .page-banner {
    height: 150px;
  }

  .page-banner-content h1 {
    font-size: 2rem;
  }

  .page-banner-content p {
    font-size: 1rem;
  }
}

/* About 頁面專用樣式 */
.about-page .content {
  margin: 0 auto;
}

.about-page .content section {
  margin-bottom: 3rem;
  width: 100%;
}

.about-page .content section:last-child {
  margin-bottom: 0;
}

.about-page .content h2 {
  color: var(--primary-color);
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

.about-page .content p {
  color: #333;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  width: 100%;
  padding: 0 2rem;
  text-align: justify;
}

.about-page #overview {
  width: 100%;
  max-width: none;
  padding: 0;
}

.about-page #overview h2 {
  width: 100%;
  padding: 0 2rem;
}

.about-page #overview p {
  width: 100%;
  padding: 0 2rem;
  text-align: justify;
}

.about-page #overview p:first-of-type {
  background-color: var(--bgl);
  padding: 2rem;
  border-radius: 8px;
  border-left: 4px solid var(--accent-color);
  margin-bottom: 2rem;
}

.about-page #overview ul {
  width: 100%;
  padding-left: 2rem;
  margin-bottom: 2rem;
}

.about-page #overview ul li {
  width: 100%;
  margin-bottom: 1rem;
  line-height: 1.8;
  color: #333;
  font-size: 1.1rem;
  text-align: justify;
}

.about-page #overview .image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin: 2rem 0;
  padding: 0 2rem;
}

.about-page #overview .image-container img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .about-page .content h2 {
    font-size: 1.5rem;
  }

  .about-page .content p {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .about-page #overview h2 {
    padding: 0 1rem;
  }

  .about-page #overview p {
    padding: 0 1rem;
  }

  .about-page #overview p:first-of-type {
    padding: 1.5rem;
  }

  .about-page #overview ul {
    padding-left: 1.5rem;
  }

  .about-page #overview .image-container {
    padding: 0 1rem;
  }
}

/* Results 頁面專用樣式 */
.results-page .content-nav {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bdl);
}

.results-page .content-nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.results-page .content-nav a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.results-page .content-nav a:hover {
  background-color: var(--bdl);
  color: var(--accent-color);
}

/* News 頁面專用樣式 */
.news-page .content {
  margin: 0 auto;
}

@media (max-width: 768px) {

  /* 在手機上調整新聞頁卡片內的內邊距 */
  .news-page .news-content {
    padding: 1.2rem;
  }

  .news-page .news-content h3 {
    font-size: 1.1rem;
    /* 手機上標題稍小 */
  }

  .news-page .news-content p {
    font-size: 0.95rem;
    /* 手機上文字稍小 */
  }
}

/* Contact 頁面專用樣式 */
.contact-page .page-container {
  max-width: 1200px;
}

.contact-page .content {
  margin: 0 auto;
}

.contact-page .contact-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.contact-page .contact-item {
  background: #FFF;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--bdl);
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.contact-page .contact-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.contact-page .contact-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  background: var(--bgl);
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.contact-page .contact-item:hover .contact-icon {
  background: var(--primary-color);
  color: #FFF;
}

.contact-page .contact-item h3 {
  color: var(--primary-color);
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.contact-page .contact-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.contact-page .contact-details p {
  color: #666;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bgl);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.contact-page .contact-details p:hover {
  background: var(--primary-color);
  color: #FFF;
}

.contact-page .contact-details p:hover i {
  color: #FFF;
}

.contact-page .contact-details i {
  color: var(--accent-color);
  font-size: 1.2rem;
}

@media (max-width: 1200px) {
  .contact-page .contact-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .contact-page .contact-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .contact-page .contact-info-grid {
    grid-template-columns: 1fr;
  }

  .contact-page .contact-item {
    padding: 1.5rem;
    min-height: 250px;
  }

  .contact-page .contact-icon {
    font-size: 2.5rem;
    width: 70px;
    height: 70px;
  }

  .contact-page .contact-item h3 {
    font-size: 1.2rem;
  }

  .contact-page .contact-details p {
    font-size: 1rem;
  }
}

/* 圖片容器樣式 */
.image-container {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 8px;
  margin: 1rem 0;
}

.image-container img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 8px;
}

/* === Team Pages CSS === */
.team-page .content-title {
  color: var(--primary-color);
  font-size: 2.2rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--accent-color);
}

/* Leader 頁面專用樣式 */
.leader-content {
  max-width: 800px;
  /* Removed margin: 0 auto; as it's inside a grid column */
  padding: 1.2rem;
  background: #FFF;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--bdl);
  /* margin-bottom: 1.5rem; Added dynamically in v-for */
}

.leader-content h3 {
  color: var(--primary-color);
  font-size: 1.8rem;
  font-weight: 600;
  border-bottom: none;
  padding-left: 1.5rem;
  padding-bottom: 0;
  margin-left: 0;
  margin-bottom: 0.6rem;
}

/* Shared paragraph style within leader blocks */
.leader-content p {
  color: #333;
  padding-left: 1.5rem;
  margin: 0.2em 0;
}

.leader-content .department {
  font-size: 1.1em;
  position: relative;
  /* Keep for potential future ::before pseudo-elements */
}

.leader-content .department::before {
  display: none;
  /* Ensure no pseudo-element is shown */
}

.leader-content .contact-block {
  margin-top: 0.8rem !important;
  /* Ensure spacing */
  padding-top: 0.8rem !important;
  border-top: 1px solid var(--bdl);
  /* Separator line */
}

.leader-content .contact-block p {
  display: flex;
  align-items: center;
  gap: 0.8em;
}

.leader-content .contact-block i {
  color: var(--accent-color);
  font-size: 1.2em;
  width: 1.5em;
  text-align: center;
}

.leader-content .contact-block .website a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.leader-content .contact-block .website a:hover {
  color: var(--accent-color);
}

/* Styles for Researchers and Assistants Lists */
.researchers-list {
  /* Container for the list items */
  margin-top: 2rem;
}

/* Styling for EACH item in the Researchers/Assistants list */
.researcher-item {
  /* Applied to both researchers and assistants now */
  padding: 1.2rem 1rem;
  border-bottom: 1px solid var(--bdl);
  display: flex;
  align-items: baseline;
  /* Align text baselines */
  gap: 1.5rem;
  flex-wrap: wrap;
  /* Allow wrapping */
}

.researcher-item:last-child {
  border-bottom: none;
  /* Remove border from last item */
}

.researcher-item .name {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 1.1rem;
  flex: 1 1 25%;
  /* Grow, shrink, basis */
  min-width: 180px;
  /* Prevent name being too squished */
}

.researcher-item .title {
  color: var(--accent-color);
  font-weight: 500;
  flex: 0 0 auto;
  /* Don't grow or shrink */
  padding-right: 1rem;
  /* Space before department */
}

.researcher-item .department {
  color: #666;
  flex: 2 1 50%;
  /* Grow more, basis */
  line-height: 1.5;
}


/* --- Responsive Adjustments for Team Pages --- */
@media (max-width: 768px) {

  .team-page .content-title {
    font-size: 1.8rem;
  }

  /* Specific adjustments for leader content on small screens */
  .leader-content {
    padding: 1rem;
  }

  .leader-content h3 {
    font-size: 1.6rem;
    padding-left: 1rem;
    /* Reduce indent */
  }

  .leader-content p {
    padding-left: 1rem;
    /* Reduce indent */
  }

  .leader-content .department {
    font-size: 1em;
  }

  .leader-content .contact-block {
    margin-top: 0.6rem !important;
    padding-top: 0.6rem !important;
  }

  .leader-content .contact-block p {
    font-size: 0.95em;
    /* Slightly smaller text */
    gap: 0.5em;
  }

  .leader-content .contact-block i {
    font-size: 1.1em;
    width: 1.3em;
  }


  /* Stack researcher/assistant item details vertically */
  .researcher-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    /* Reduce gap when stacked */
  }

  .researcher-item .name,
  .researcher-item .title,
  .researcher-item .department {
    flex-basis: auto;
    /* Reset flex basis */
    width: 100%;
    /* Take full width */
    min-width: 0;
    text-align: left;
    padding-right: 0;
  }

  .researcher-item .title {
    margin-top: 0.2rem;
  }

  .researcher-item .department {
    font-size: 0.95em;
    margin-top: 0.2rem;
  }
}

/* --- Login Modal --- */
.login-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1010;
  /* Ensure it's above other content */
}

.login-modal-content {
  background-color: #fff;
  padding: 30px 40px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 400px;
  position: relative;
  text-align: center;
}

.login-modal-content h2 {
  margin-bottom: 20px;
  color: var(--primary-color);
}

.login-modal-content form input {
  display: block;
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
}

.login-modal-content form button {
  background-color: var(--accent-color);
  color: var(--primary-color);
  font-weight: bold;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  width: 100%;
  transition: background-color 0.3s ease;
}

.login-modal-content form button:hover {
  background-color: #e0655a;
}

.login-modal-content form button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.close-modal-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
}

.close-modal-btn:hover {
  color: #333;
}

/* --- Add styles for Data Search Page --- */

.search-controls .subsection-title,
.search-results .subsection-title {
  font-size: 1.5em;
  /* Slightly smaller than page title */
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #eee;
}

/* Reuse existing form styles if they match */
.search-controls .form-group {
  margin-bottom: 0.5rem;
}

.search-controls .form-group label {
  /* Label for sections like Type, Fields, Keyword */
  display: block;
  font-weight: 600;
  color: #333;
  margin: 0.4rem 0;
}

.search-controls .checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 15px;
  /* Vertical and horizontal gap */
}

.search-controls .checkbox-group label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-weight: normal;
  background-color: var(--bgl);
  padding: 6px 12px;
  border-radius: 15px;
  /* Pill shape */
  border: 1px solid #ddd;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  font-size: 0.95em;
}

.search-controls .checkbox-group label:hover {
  background-color: #e9ecef;
}

.search-controls .checkbox-group input[type="checkbox"] {
  margin-right: 8px;
  accent-color: var(--primary-color);
  /* Color the checkbox itself */
}

.search-controls .attribute-group .attr-type {
  /* (共通) or (特定) indicator */
  font-size: 0.8em;
  color: #6c757d;
  margin-left: 4px;
  font-style: italic;
}

.search-controls .info-text {
  font-size: 0.9em;
  color: #6c757d;
  margin-top: 5px;
}

.search-controls input[type="text"] {
  /* Keyword input */
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
}

.search-controls .submit-btn {
  /* Reuse existing button style or define */
  background-color: var(--accent-color);
  color: var(--primary-color);
  font-weight: bold;
  border: none;
  padding: 10px 25px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease;
  margin-top: 1rem;
  /* Add some space above the button */
}

.search-controls .submit-btn:hover {
  background-color: #e0655a;
}

.search-controls .submit-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}


/* Search Results Styles */
.search-results .loading-indicator,
.search-results .error-message,
.search-results p {
  /* Status messages */
  margin-top: 1rem;
  font-size: 1.05em;
  color: #555;
}

.search-results .error-message {
  color: #dc3545;
  /* Red for errors */
  font-weight: 500;
}

.search-results .loading-indicator i,
.search-results .error-message i,
.search-results p i {
  /* Icons */
  margin-right: 8px;
  color: #6c757d;
  /* Default icon color */
}

.search-results .error-message i {
  color: #dc3545;
}

/* Error icon color */
.search-results p .fa-info-circle {
  color: #0d6efd;
}

/* Info icon color */




/* --- Missing Search & Data Page Styles --- */

/* Select Styling */
.search-controls select {
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  color: var(--text-color-base);
  background-color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.search-controls select:hover {
  border-color: var(--accent-color);
}

.search-controls select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(44, 44, 97, 0.1);
}

/* Checkbox Button Styling */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.checkbox-label:hover {
  background-color: #f0f0f5;
  border-color: var(--primary-color);
}

.checkbox-label input[type='checkbox'] {
  accent-color: var(--primary-color);
  width: 16px;
  height: 16px;
}

/* Scrollable Container for Constructs */
.scroll-x-container {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.scroll-x-container::-webkit-scrollbar {
  height: 6px;
}

.scroll-x-container::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 4px;
}

.construct-checkbox-label {
  flex: 0 0 auto;
}

/* Results Table & Sticky Columns */
.results-table-container {
  margin-top: 0.5rem;
}

.table-container {
  overflow-x: auto;
  overflow-y: auto;
  /* Allow vertical scroll */
  max-height: 600px;
  /* Fixed height for scrolling */
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-top: 1rem;
  position: relative;
}

.results-table {
  width: max-content;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 0;
  font-size: 0.95em;
}

.results-table th,
.results-table td {
  padding: 10px 12px;
  /* Restored tighter padding */
  text-align: left;
  vertical-align: top;
  /* Restored alignment */
  border-bottom: 1px solid #ddd;
  /* Restored darker border color */
  border-right: 1px solid transparent;
  /* Placeholder */
}

.results-table th {
  white-space: nowrap;
  position: sticky;
  top: 0;
  /* Explicitly stick to top */
  z-index: 30;
  box-shadow: 0 1px 0 #ddd;
  background-color: var(--bgl);
  border-bottom: none;
  /* Rely on box-shadow for sticky border */
}

.results-table tr:hover td {
  background-color: #f8f9fa;
}

.results-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
  /* Zebra striping conslidated */
}

/* Sticky ID Column (1st) - 固定寬度 60px */
.results-table tr.construct-header-row th:nth-child(1),
.results-table tbody td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 20;
  background-color: #fff;
  border-right: 1px solid var(--bdl);
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  text-align: center;
  box-sizing: border-box;
  white-space: nowrap;
}

.results-table tr.construct-header-row th:nth-child(1) {
  z-index: 50;
  background-color: var(--primary-color);
  color: #fff;
  text-align: center;
}

/* Sticky Source Column (2nd) - 固定寬度 130px */
.results-table tr.construct-header-row th:nth-child(2),
.results-table tbody td:nth-child(2) {
  position: sticky;
  left: 60px;
  /* Width of ID column */
  z-index: 20;
  background-color: #fff;
  border-right: 2px solid #cbd5e1;
  width: 130px;
  min-width: 130px;
  max-width: 130px;
  text-align: center;
  padding: 10px 8px;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.results-table tr.construct-header-row th:nth-child(2) {
  z-index: 50;
  background-color: var(--primary-color);
  color: #fff;
  text-align: center;
}

/* Sortable Column Header Styles */
.results-table th.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.results-table th.sortable-th:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.results-table tr.construct-header-row th.sortable-th:hover {
  background-color: #1e1b4b !important;
  color: #fff;
}

.sort-icon {
  display: inline-block;
  font-size: 0.72rem;
  margin-left: 3px;
  vertical-align: middle;
  line-height: 1;
}

.sort-icon-dim {
  opacity: 0.35;
}

.results-table th.sortable-th:hover .sort-icon-dim {
  opacity: 0.85;
}

/* Zebra striping for sticky columns */
.results-table tbody tr:nth-child(even) td:nth-child(1),
.results-table tbody tr:nth-child(even) td:nth-child(2) {
  background-color: #f9f9f9;
}

/* Row Hover fix for sticky columns */
.results-table tbody tr:hover td:nth-child(1),
.results-table tbody tr:hover td:nth-child(2) {
  background-color: #f1f5f9;
}

/* Search Button Styles */
.btn {
  display: inline-block;
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: #fff;
  box-shadow: 0 4px 15px rgba(44, 44, 97, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Construct Section Styles */
.construct-section {
  background: var(--bgl);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.5rem;
  min-height: 145px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.section-title {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.9rem;
}

.section-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checkbox-label.partial-toggle-label {
  padding: 3px 10px;
  font-size: 0.8rem;
  border-radius: 16px;
}

.btn-small {
  padding: 4px 12px;
  font-size: 0.8rem;
  border: 1px solid var(--primary-color);
  background: transparent;
  color: var(--primary-color);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-small:hover:not(:disabled) {
  background: var(--primary-color);
  color: #fff;
}

.btn-small:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: #ccc;
  color: #999;
}

/* Unique Constructs Grid */
.unique-constructs-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.unique-construct-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.unique-construct-group .sub-label {
  font-weight: 600;
  color: var(--primary-color);
  min-width: 40px;
}

.unique-construct-group .checkbox-label {
  opacity: 0.6;
}

/* Construct Spanning Headers */
.construct-header-row th {
  color: #fff;
  background-color: var(--primary-color);
  z-index: 35;
  height: 50px;
  line-height: 1.2;
  /* Better for wrapping text */
  padding-top: 5px;
  padding-bottom: 5px;
}

/* Rowspan cells need to stay on top */
.construct-header-row th[rowspan] {
  z-index: 50;
  background-color: var(--primary-color);
}

.construct-header {
  text-align: center;
  border-left: 2px solid rgba(255, 255, 255, 0.3);
  border-right: 2px solid rgba(255, 255, 255, 0.3);
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  box-shadow: none;
}

.btn-outline:hover {
  background: rgba(44, 62, 80, 0.05);
  /* Light primary color hover */
}

/* Second header row - offset by first row height */
.results-table thead tr:nth-child(2) th {
  top: 50px;
  /* Increased from 40px to accommodate taller headers */
  z-index: 30;
  height: 40px;
  /* Fixed height for second row */
}



.construct-header {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 6px;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

.question-header {
  font-size: 0.85rem;
  background-color: var(--bgl) !important;
  color: var(--primary-color);
  font-weight: 600;
  cursor: help;
  /* Indicate tooltip */
  width: 70px;
  min-width: 70px;
  max-width: 70px;
  text-align: center;
  padding: 8px 4px;
  box-sizing: border-box;
}

/* Question score data cells (3rd column onward) */
.results-table td:nth-child(n+3) {
  width: 70px;
  min-width: 70px;
  max-width: 70px;
  text-align: center;
  padding: 8px 4px;
  box-sizing: border-box;
}

/* Custom CSS Tooltip */

.results-table thead th.question-header[data-tooltip]:hover {
  z-index: 60;
}

.question-header[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  left: 0;
  /* Removed transform center */
  background: #333;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  white-space: pre-wrap;
  width: max-content;
  max-width: 300px;
  text-align: left;
  z-index: 1000;
  font-weight: 400;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin-top: 5px;
  pointer-events: none;
}

.results-table thead tr:nth-child(2) th:nth-child(n+5):nth-last-child(-n+4).question-header[data-tooltip]:hover::after {
  left: auto;
  right: 0;
}

/* ==========================================================================
   統計指標卡片儀表板樣式 (Statistical Indicator Dashboard Styles)
   ========================================================================== */

.stats-dashboard-container {
  margin-bottom: 1.5rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem 1.25rem 1rem 1.25rem;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

.stats-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.stats-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stats-badge-tag {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(30, 27, 75, 0.2);
}

.stats-desc-text {
  font-size: 0.88rem;
  color: #64748b;
}

.stats-toggle-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.stats-toggle-btn:hover {
  background: #f1f5f9;
  color: var(--primary-color);
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.badge-mini {
  background: #e2e8f0;
  color: #475569;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
  margin-left: 2px;
}

/* 4 核心指標卡片 Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

@media (min-width: 992px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: #ffffff;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.08);
}

.stat-card-blue {
  border-top: 3px solid #3b82f6;
  background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
}

.stat-card-green {
  border-top: 3px solid #10b981;
  background: linear-gradient(180deg, #f7fdfa 0%, #ffffff 100%);
}

.stat-card-amber {
  border-top: 3px solid #f59e0b;
  background: linear-gradient(180deg, #fffcf5 0%, #ffffff 100%);
}

.stat-card-purple {
  border-top: 3px solid #8b5cf6;
  background: linear-gradient(180deg, #faf7ff 0%, #ffffff 100%);
}

.stat-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.stat-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.stat-card-blue .stat-card-icon {
  background: #eff6ff;
  color: #3b82f6;
}

.stat-card-green .stat-card-icon {
  background: #ecfdf5;
  color: #10b981;
}

.stat-card-amber .stat-card-icon {
  background: #fffbeb;
  color: #f59e0b;
}

.stat-card-purple .stat-card-icon {
  background: #f5f3ff;
  color: #8b5cf6;
}

.stat-card-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
}

.stat-card-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  margin-bottom: 0.45rem;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.stat-card-unit {
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
  margin-left: 3px;
}

.stat-card-sub {
  font-size: 0.78rem;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.stat-pill {
  background: #e2e8f0;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

/* 構念與極值抽屜內容樣式 */
.stats-drawer-content {
  margin-top: 1.15rem;
  padding: 1.15rem;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  animation: fadeIn 0.25s ease-in-out;
}

.construct-stats-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.drawer-subtitle {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.85rem 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.construct-bar-item {
  margin-bottom: 0.75rem;
}

.construct-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.construct-name {
  font-weight: 600;
  color: #334155;
}

.construct-score {
  font-size: 0.82rem;
  color: #1e293b;
}

.construct-progress-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.construct-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #6366f1 100%);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.extreme-item-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.extreme-high {
  border-left: 4px solid #10b981;
}

.extreme-low {
  border-left: 4px solid #f43f5e;
}

.extreme-item-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 0.35rem;
}

.extreme-high .extreme-item-badge {
  background: #ecfdf5;
  color: #065f46;
}

.extreme-low .extreme-item-badge {
  background: #fff1f2;
  color: #9f1239;
}

.extreme-item-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.35rem;
}

.extreme-item-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.extreme-item-score {
  font-size: 0.85rem;
  color: #1e293b;
}

.extreme-item-desc {
  font-size: 0.78rem;
  color: #64748b;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .construct-stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* 最新消息互動展開與重點提示 */
.news-filter-notice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background-color: var(--bgl, #eff6ff);
  border-left: 4px solid var(--primary-color, #1a56db);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

.news-reset-link {
  color: var(--primary-color, #1a56db);
  font-weight: 600;
  text-decoration: none;
}

.news-reset-link:hover {
  text-decoration: underline;
}

.news-card.is-highlighted {
  border-color: var(--primary-color, #1a56db);
  box-shadow: 0 6px 18px rgba(26, 86, 219, 0.16);
}

.news-detail {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==========================================================================
   學生訪談質性資料模組與受訪者問卷關聯抽屜樣式 (Phase 13 §4.1)
   ========================================================================== */

.qual-mode-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.qual-ethics-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #f0f9ff 0%, #eff6ff 100%);
  border: 1px solid #bfdbfe;
  border-left: 4px solid var(--primary-color);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.qual-ethics-text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 420px;
}

.qual-ethics-text strong {
  color: var(--primary-color);
  font-size: 0.98rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.qual-ethics-text span {
  color: #334155;
  font-size: 0.88rem;
  line-height: 1.5;
}

.qual-rbac-pill {
  background: var(--primary-color);
  color: #fff;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.qual-lookup-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1.15rem;
}

.qual-lookup-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.qual-lookup-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1 1 320px;
  justify-content: flex-end;
}

.qual-input-compact,
.qual-text-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.92rem;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.qual-input-compact {
  min-width: 240px;
}

.qual-text-input {
  width: 100%;
  box-sizing: border-box;
}

.qual-input-compact:focus,
.qual-text-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12);
}

.btn-small-solid {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.btn-small-solid:hover:not(:disabled) {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.qual-controls-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.qual-filter-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.qual-filter-col-wide {
  flex: 2 1 320px;
}

.qual-filter-col-narrow {
  flex: 1 1 200px;
}

.qual-actions-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.qual-onboarding-card {
  background: #ffffff;
  border: 1px dashed #94a3b8;
  border-radius: 12px;
  padding: 1.5rem;
}

.qual-onboarding-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.qual-onboarding-header > i {
  font-size: 1.8rem;
  color: var(--accent-color);
  margin-top: 0.15rem;
}

.qual-onboarding-header h3 {
  margin: 0 0 0.4rem 0;
  color: var(--primary-color);
  font-size: 1.12rem;
}

.qual-onboarding-header p {
  margin: 0;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.6;
}

.qual-schema-box h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #1e293b;
}

.qual-schema-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.qual-schema-table th,
.qual-schema-table td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.qual-schema-table th {
  background: #f8fafc;
  color: var(--primary-color);
  font-weight: 700;
}

.qual-results-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.qual-results-summary-bar h3 {
  margin: 0;
  color: #0f172a;
}

.qual-results-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.qual-result-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.qual-result-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.qual-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid #f1f5f9;
}

.qual-card-id-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.subject-id-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--primary-color);
  background: #eff6ff;
  color: var(--primary-color);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.subject-id-chip:hover {
  background: var(--primary-color);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(44, 44, 97, 0.22);
}

.chip-action-hint {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.85;
}

.qual-meta-badge {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
}

.qual-meta-badge.badge-project {
  background: #e0e7ff;
  color: #3730a3;
}

.qual-meta-badge.badge-year {
  background: #ecfdf5;
  color: #065f46;
}

.qual-meta-badge.badge-category {
  background: #f3f4f6;
  color: #1f2937;
}

.qual-theme-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.theme-code-pill {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.qual-card-section + .qual-card-section {
  margin-top: 0.75rem;
}

.qual-section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.qual-summary-text {
  margin: 0;
  color: #0f172a;
  font-size: 0.96rem;
  line-height: 1.65;
  font-weight: 500;
}

.qual-transcript-text {
  margin: 0;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-left: 3px solid #94a3b8;
  border-radius: 0 6px 6px 0;
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.qual-transcript-text.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.qual-highlight {
  background: #fef08a;
  color: #0f172a;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 700;
}

/* Subject Survey Slide-Over Drawer */
.subject-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 2500;
  display: flex;
  justify-content: flex-end;
}

.subject-drawer {
  width: min(740px, 100vw);
  height: 100vh;
  background: #ffffff;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.subject-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.4rem;
  background: var(--primary-color);
  color: #ffffff;
  gap: 1rem;
}

.subject-drawer-eyebrow {
  font-size: 0.78rem;
  opacity: 0.88;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.subject-drawer-title {
  margin: 0;
  font-size: 1.2rem;
  color: #fff;
}

.subject-drawer-title code {
  background: rgba(255, 255, 255, 0.16);
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  font-size: 1.1rem;
  color: #fff;
}

.subject-drawer-close {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.subject-drawer-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.subject-drawer-body {
  padding: 1.25rem 1.4rem 2rem;
  overflow-y: auto;
  flex: 1;
}

.subject-drawer-alert {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border-radius: 8px;
}

.subject-drawer-alert i {
  font-size: 1.25rem;
  margin-top: 0.15rem;
}

.subject-drawer-alert p {
  margin: 0.3rem 0 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.subject-drawer-alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.subject-drawer-alert-empty {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.subject-year-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.subject-year-tab {
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.subject-year-tab.is-active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.subject-overview-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.subject-overview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.subject-overview-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.92rem;
  color: #0f172a;
}

.overview-stat-label {
  color: #64748b;
  margin-right: 0.4rem;
}

.subject-demographics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
}

.demo-chip {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.22rem 0.55rem;
  font-size: 0.8rem;
  color: #1e293b;
}

.demo-label {
  color: #64748b;
}

.subject-construct-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.subject-construct-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.subject-construct-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.subject-construct-header h4 {
  margin: 0;
  font-size: 0.94rem;
  color: var(--primary-color);
}

.construct-mean-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #dbeafe;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
}

.subject-item-list {
  display: flex;
  flex-direction: column;
}

.subject-item-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 72px;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
}

.subject-item-row:last-child {
  border-bottom: none;
}

.subject-item-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  color: #475569;
  font-size: 0.82rem;
}

.subject-item-text {
  color: #1e293b;
  line-height: 1.45;
}

.subject-item-score {
  text-align: right;
}

.score-pill {
  display: inline-block;
  min-width: 34px;
  text-align: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
}

.score-pill-high {
  background: #dcfce7;
  color: #166534;
}

.score-pill-mid {
  background: #fef3c7;
  color: #92400e;
}

.score-pill-low {
  background: #fee2e2;
  color: #991b1b;
}

.score-pill-neutral {
  background: #f1f5f9;
  color: #64748b;
}

.subject-openended-section {
  margin-top: 1.25rem;
}

.subject-openended-section h4 {
  margin: 0 0 0.65rem 0;
  color: var(--primary-color);
  font-size: 0.96rem;
}

.subject-openended-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
}

.openended-question {
  font-size: 0.86rem;
  color: #475569;
  margin-bottom: 0.35rem;
}

.openended-answer {
  margin: 0;
  font-size: 0.92rem;
  color: #0f172a;
  line-height: 1.6;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .qual-lookup-controls {
    justify-content: flex-start;
  }

  .qual-input-compact {
    min-width: 0;
    width: 100%;
  }

  .subject-item-row {
    grid-template-columns: 62px minmax(0, 1fr) 58px;
    padding: 0.5rem 0.65rem;
  }
}
