/* 卡片容器 */
.head-content {
    flex-wrap: wrap;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: auto;
    gap: 16px;
    padding: 12px;
}

.card {
    position: relative; /* 很关键 */
    display: inline-block;
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: none;
    opacity: 0;
    flex-shrink: 0;
    transform: translateX(-100vw);
}

.card img {
    width: 100%;
    height: auto;  /* 保证图片不变形 */
    display: block;
    border-radius: 12px;
}

.card.start {
    animation-name: slide;
    animation-fill-mode: both;
    animation-timing-function: ease;
}

.card.end {
    animation-name: slide-end;
    animation-fill-mode: both;
    animation-timing-function: ease;
}

@keyframes slide {
    0% {
        transform: translateX(-100vw);
        opacity: 0;
        border-radius: 0px;
    }
    50% {
        border-radius: 0px;
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
        border-radius: 12px;
    }
}

@keyframes slide-end {
    0% {
        transform: translateX(0);
        opacity: 1;
        border-radius: 12px;
    }
    50% {
        border-radius: 12px;
        opacity: 1;
    }
    100% {
        transform: translateX(-100vw);
        opacity: 0;
        border-radius: 0px;
    }
}

/* 让链接覆盖整个卡片 */
.card a {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0);  /* 初始透明 */
    color: transparent;                 /* 不显示文本 */
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}

/* 当鼠标悬停时，改变链接的背景色 */
.card a:hover {
    background-color: rgba(0, 0, 0, 0.1); /* 增加透明的背景色 */
    color: white; /* 悬停时文字变为白色 */
}

.card-tile-text-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    padding: 12px;
    box-sizing: border-box;

}

.card * {
  display: block;
  justify-content: initial;
  align-items: initial;
  user-select: text;
}

.card-tile-text {
  color: white;
  font-size: 14px;
  line-height: 1.4;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;

}


/* 电脑端，一行显示六个卡片 */
@media (min-width: 1024px) {
    .card {
        width: calc((100% - 5 * 16px) / 6); /* 每行6个，考虑gap共5个 */
    }
}

/* 手机版，一行显示两个卡片 */
@media (max-width: 767px) {
    .card {
        width: calc((100% - 16px) / 2); /* 每行2个卡片，1个 gap */
    }
}


/* 中等屏幕，适配平板，默认一行3个卡片 */
@media (min-width: 768px) and (max-width: 1023px) {
    .card {
        width: calc((100% - 2 * 16px) / 3); /* 每行3个，考虑gap共2个 */
    }
}

