/* --- 版面容器 --- */
.container {
  max-width: 1000px; /* 限制內容最大寬度，閱讀較舒適 */
  margin: 40px auto;
  padding: 0 20px;
  min-height: 60vh; /* 確保內容少時，footer 不會浮上來 */
}

.main-content {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05); /* 柔和的陰影 */
}

/* --- 標題裝飾 --- */
.section-title {
  font-size: 28px;
  margin-bottom: 30px;
  color: #2c3e50;
  border-left: 6px solid #7f2568; /* 梅竹紫 */
  padding-left: 15px;
  line-height: 1;
}

/* --- 頁籤切換區 (Tabs) --- */
.news-tabs {
  display: flex;
  border-bottom: 2px solid #eee;
  margin-bottom: 30px;
  gap: 10px;
}

.tab {
  padding: 12px 30px;
  cursor: pointer;
  font-weight: bold;
  font-size: 18px;
  color: #888;
  border-radius: 8px 8px 0 0;
  transition: all 0.3s;
}

.tab:hover {
  background-color: #f9f9f9;
  color: #7f2568;
}

.tab.active {
  background-color: #7f2568;
  color: #fff;
}

/* --- 新聞列表 (News List) --- */
.news-list {
  list-style: none;
}

.news-item {
  display: flex;
  align-items: flex-start;
  gap: 25px;
  padding: 25px 0;
  border-bottom: 1px dashed #ddd; /* 虛線分隔 */
  transition:
    transform 0.2s ease,
    background-color 0.2s;
}

.news-item:hover {
  background-color: #fbfbfb;
  transform: translateX(5px); /* 滑鼠移上去稍微往右移 */
}

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

/* --- 圖片區塊 --- */
.news-image-box {
  flex: 0 0 220px; /* 固定寬度 */
  height: 140px; /* 固定高度 */
  border-radius: 8px;
  overflow: hidden;
  background-color: #eee;
  border: 1px solid #eee;
}

.news-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 確保圖片填滿且不變形 */
  display: block;
  transition: transform 0.5s ease;
}

.news-item:hover .news-image-box img {
  transform: scale(1.1); /* 圖片微放大特效 */
}

/* --- 文字內容區塊 --- */
.news-content-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 140px; /* 對齊圖片高度 */
}

.news-title {
  font-size: 20px;
  font-weight: 700;
  color: #2c3e50;
  text-decoration: none;
  margin-bottom: 15px;
  line-height: 1.5;

  /* 超出兩行顯示省略號 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-title:hover {
  color: #7f2568;
}

.news-meta {
  display: flex;
  align-items: center;
}

.news-date {
  font-size: 14px;
  color: #999;
  background-color: #f0f0f0;
  padding: 4px 10px;
  border-radius: 4px;
}

/* --- RWD 響應式設定 --- */
@media (max-width: 768px) {
  .news-item {
    flex-direction: column; /* 手機版改為直式 */
    gap: 15px;
  }

  .news-image-box {
    flex: none;
    width: 100%;
    height: 200px; /* 手機版圖片變大張 */
  }

  .news-content-box {
    height: auto;
  }

  .news-title {
    font-size: 18px;
    margin-bottom: 10px;
  }
}
