.carousel {
  position: relative;
  padding: 20px 0;
  max-width: 100vw;
}
/* 可滚动的卡片行 */
.carousel-container {
  display: flex;
  max-width: 100vw;
  gap: 0px;
  overflow-x: auto; /* 支持横向滚动 */
  scroll-behavior: smooth; /* 点击箭头时平滑滚动 */
  -webkit-overflow-scrolling: touch; /* iOS 上更顺滑 */
  padding-bottom: 20px;
  padding-top: 20px; /* 增加左右padding，为放大卡片留空间 */
  padding-left: 0 !important;
  padding-right: 0 !important;
/* 隐藏原生滚动条 */
  scrollbar-width: none; /* Firefox */
}
.carousel-container::-webkit-scrollbar {
  display: none; /* Safari & Chrome */
}
.card {
  position: relative;
  margin-left: 16px;
  flex: 0 0 auto;
  width: 290px;
  height: 440px;
  border-radius: 12px;
  box-shadow: 0 3px 3px rgba(0,0,0,0);
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* 平滑过渡放大和阴影 */
}
.card:last-child {
  margin-right: 16px; /* 第一个卡片无左间距 */
}
/* 自定义卡片尺寸 */
.horizontal .card {
  width: 336px;
  height: 216px;
}
.vertical .card {
  width: 264px;
  height: 360px;
}
/* 卡片悬浮蒙层，覆盖整个卡片包括标签 */
.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 8; /* 蒙层覆盖图片和信息区域 */
  border-radius: 12px; /* 与卡片相同的圆角 */
}
/* 鼠标悬浮时显示蒙层并放大整个卡片 */
.card:hover {
  transform: scale(1.05); /* 放大整个卡片 */
  box-shadow: 0 3px 6px rgba(0,0,0,0.1); /* 增强阴影 */
  z-index: 15; /* 提升层级，避免被相邻卡片或容器遮挡 */
}
.card:hover::after {
  opacity: 1; /* 显示蒙层 */
}
/* 图片铺满整个卡片 */
.card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px; /* 与卡片相同的圆角 */
}
/* 卡片链接样式 */
.card a {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9; /* 确保链接在蒙层之上 */
  text-decoration: none; /* 移除下划线 */
}
/* 信息区域 */
.card-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  backdrop-filter: blur(8px);
  background-color: rgba(255,255,255,0.4);
  color: #111;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  z-index: 7; /* 信息区域在图片之上，蒙层之下 */
  border-bottom-left-radius: 12px; /* 与卡片底部圆角一致 */
  border-bottom-right-radius: 12px;
}
/* 让每一行之间都有固定间距 */
.card-info > * + * {
  margin-top: 4px;
}
.card-info .description + .year {
  margin-top: 0px;
}
/* 标题 */
.card-info h3 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: bold;
}
/* 描述（跑马灯） */
.description {
  width: 100%;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.7rem;
  margin: 0;
}
.marquee-content {
  display: inline-flex;
  animation: scroll var(--marquee-time) infinite;
}
.marquee-content span + span {
  margin-left: 4rem;
}
/* 年份行 */
.card-info p.year {
  font-size: 0.7rem;
}
/* 箭头按钮图标 */
.carousel-arrow .arrow-icon {
  display: inline-block;
  position: relative;
  top: -2px;
}
/* 箭头按钮 */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.3);
  color: #fff;
  font-size: 24px;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 20; /* 箭头在所有内容之上 */
}
.carousel:hover .carousel-arrow {
  opacity: 1;
}
.carousel-arrow.left {
  left: 8px;
}
.carousel-arrow.right {
  right: 8px;
}
.card:hover .marquee-content {
  animation-play-state: paused; /* 悬浮时暂停跑马灯 */
}
/* Dark Mode Media Query */
@media (prefers-color-scheme: dark) {
  .card {
    box-shadow: 0 4px 8px rgba(255,255,255,0.1);
  }
  .card-info {
    background: rgba(0,0,0,0.4);
    background-color: rgba(0,0,0,0.4);
    color: #eee;
  }
  .carousel-arrow {
    background: rgba(255,255,255,0.3);
    color: #000;
  }
  .card:hover {
    box-shadow: 0 6px 12px rgba(255,255,255,0.2);
  }
}
@-moz-keyframes scroll {
  0% {
    transform: translateX(0);
  }
  17% {
    transform: translateX(0);
    animation-timing-function: ease-in-out;
  }
  100% {
    transform: translateX(calc(-1 * var(--marquee-dist)));
  }
}
@-webkit-keyframes scroll {
  0% {
    transform: translateX(0);
  }
  17% {
    transform: translateX(0);
    animation-timing-function: ease-in-out;
  }
  100% {
    transform: translateX(calc(-1 * var(--marquee-dist)));
  }
}
@-o-keyframes scroll {
  0% {
    transform: translateX(0);
  }
  17% {
    transform: translateX(0);
    animation-timing-function: ease-in-out;
  }
  100% {
    transform: translateX(calc(-1 * var(--marquee-dist)));
  }
}
@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  17% {
    transform: translateX(0);
    animation-timing-function: ease-in-out;
  }
  100% {
    transform: translateX(calc(-1 * var(--marquee-dist)));
  }
}
