.thumbnail {
  width: 30%;
  margin: 35px 1.5%;
  background-color: #dddddd;
  border-radius: 6px;
  border-top: 4px solid #ececec;
  border-bottom: 4px solid #c5c5c5;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;

  height: 360px; /* 固定高度 */
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  cursor: pointer;
  position: relative;
}

.thumbnail:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-4px);
}

.thumbnail:active {
  transform: scale(0.97);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.thumbnail a {
  text-decoration: none;
  color: inherit;
}

.thumbnail a:hover h4 {
  color: #7a970f;
}

.image-container {
  width: 100%;
  height: 180px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  position: relative;
}

.color-block {
  position: relative;
  background-color: #4ab900; /* 你的色块背景 */
  border-radius: 8px;
  color: white;
  display: flex;
  flex-direction: column;      /* 图片在上，文字在下 */
  align-items: center;
  justify-content: center;
  padding: 10px;
  height: 100%;                /* 保持和 image-container 匹配 */
  box-sizing: border-box;
  text-align: center;
}

.overlay-icon {
  max-width: 150px;
  max-height: 150;
  width: auto;
  height: auto;
  margin: 0 auto 10px auto;
  display: block;
  object-fit: contain;
}

.block-text {
  display: none;
  font-size: 1.4rem;
  font-weight: bold;
  width: 100%;
  text-align: center;
  max-width: 90%;
  margin: 0 auto;
}



.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* 标题 */
.gallery .thumbnail h4 {
  margin: 30px 0 5px; /* 卡片文字上方空间的距离，当前是30px */
  padding: 0 20px;
  font-size: 1.2rem;
  color: #000000;
  text-align: left;
}

/* 分类标签 */
.gallery .thumbnail p,
.gallery .thumbnail .tag {
  white-space: nowrap;            /* 不换行 */
  overflow: hidden;               /* 超出隐藏 */
  text-overflow: ellipsis;        /* 显示省略号 */

  font-size: 0.9rem;
  color: #5D5E5D;
  text-align: left;
  padding: 0 20px 6px;
  margin: 0;
}

/* 摘要 */
.summary-truncated {
  font-size: 0.92rem;
  color: #444;
  line-height: 1.4em;
  max-height: 4.2em;
  padding: 0 20px;
  text-align: left;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  line-clamp: 2; /* 控制最多显示3行 */
  overflow: hidden;
  text-overflow: ellipsis;

  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;

  box-sizing: border-box;
  flex-grow: 1;
  margin-top: 10px; /* 增加顶部间距 */
}

/* 卡片容器响应式布局 */
.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start; /* 从左开始，不拉伸对齐 */
  gap: 0%; /* 可选：卡片之间添加间距 */
}

.color-bar {
  height: 8px;
  width: 90%;
  margin: 12px auto 10px auto;
  border-radius: 8px;
  background-color: #ccc; /* 默认灰色，可选 */
}

/* 分类颜色 */
.color-bar.guiding {
  background-color: #4ab900;
}

.color-bar.indicator {
  background-color: #0099ff;
}

.color-bar.presenter {
  background-color: #ff008c;
}

/* 顶部色块颜色（高层级 pattern 专用） */
.color-block.guiding {
  background-color: #4ab900;
}

.color-block.indicator {
  background-color: #0099ff; /* 同 indicator 的底部 bar */
}

.color-block.presenter {
  background-color: #ff008c; /* 同 presenter 的底部 bar */
}


@media screen and (max-width: 800px) {
  .gallery {
    flex-direction: column;
    padding: 0 1rem;
  }

  .thumbnail {
    width: 100%;
    margin: 1rem 0;
    padding: 1rem;
    height: auto;
    border-radius: 8px;
  }

  .image-container {
    height: auto;
    max-height: 200px;
  }

  .gallery .thumbnail h4,
  .gallery .thumbnail p,
  .gallery .thumbnail .tag,
  .summary-truncated {
    padding-left: 0;
    padding-right: 0;
  }
}
