.news-gallery {
  padding: 40px;
  background: #f9f9f9;  /* 背景始终铺满 */
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 宽度自适应 */
  gap: 20px;
  justify-content: center;
  max-width: 1280px; /* 限制最大宽度，大概 4 列 */
  margin: 0 auto;
}

.news-gallery h2 {
  grid-column: 1 / -1;
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
}

.news-pic {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  transition: box-shadow 0.3s ease;
}

.news-pic:hover {
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
}

.news-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-pic:hover img {
  transform: scale(1.05); /* 只放大图片 */
}

.news-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.3));
  color: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px;
  box-sizing: border-box;
}

.news-title {
  font-size: 18px;
  font-weight: bold;
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.news-desc {
  font-size: 14px;
  margin: 0;
  height: 0;            /* 默认隐藏 */
  overflow: hidden;
  transition: height 0.3s ease, padding 0.3s ease;
  padding-top: 0;
}

.news-pic:hover .news-desc {
  height: auto;          /* 展开 */
  padding-top: 6px;      /* 给标题留间距 */
}

.news-slider {
    position: relative;   /* 关键：让按钮绝对定位参考这里 */
    width: 100%;
    overflow: hidden;
    background: #fff;
}

.news-slider .news-slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.news-slider .news-slide {
    flex: 0 0 100%;
    position: relative;
    aspect-ratio: 16 / 9;
}

.news-slider .news-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 控制按钮 */
.news-slider .news-slider-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
}

.news-slider .news-slider-controls button {
    pointer-events: auto;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}