/* ---------- 网格容器 ---------- */
.works-grid {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 48px 100px;
}
.works-grid-inner {
  position: relative;
  width: 100%;
}

/* ---------- 作品卡片 ---------- */
.work-card {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md, 16px);
  overflow: hidden;
  cursor: pointer;
  background: var(--white, #fff);
  /* 高光外圈（静止态极淡）+ 基础投影 */
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 2px 20px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.35s ease;
  opacity: 0;
  animation: cardEnter 0.55s ease forwards;
}
.work-card:hover {
  transform: translateY(-5px) scale(1.012);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.25),
    0 20px 60px rgba(0, 0, 0, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.06);
  z-index: 2;
}
.work-card .card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.work-card:hover .card-image {
  transform: scale(1.05);
}
.work-card .card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
}
.work-card:hover .card-overlay {
  opacity: 1;
}

/* 分类标签：无 backdrop-filter，避免随父级 opacity 淡入时出现模糊加载感 */
.card-overlay .card-glass-tag {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.26);
  border: 0.5px solid rgba(255, 255, 255, 0.38);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 10px;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.15),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.4);
}

.card-overlay h3 {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 3px;
}
.card-overlay p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

/* 放大图标：无 backdrop-filter，与标签同一套玻璃语言 */
.card-expand-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 0.5px solid rgba(255, 255, 255, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  box-shadow:
    0 3px 12px rgba(0, 0, 0, 0.18),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.45);
}
.work-card:hover .card-expand-icon {
  opacity: 1;
  transform: scale(1);
}
.card-expand-icon svg {
  width: 15px;
  height: 15px;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ★ 播放按钮：与标签/放大图标统一——去掉 backdrop-filter，
   底色提亮、描边提亮，靠 inset 高光维持球面立体感；
   悬停时底色微亮 + 投影加深作为抬升反馈 */
.card-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.92;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    background 0.3s ease,
    box-shadow 0.3s ease;
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.22),
    0 2px 8px rgba(0, 0, 0, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.55),
    inset 0 -1px 2px rgba(0, 0, 0, 0.06);
}
.work-card:hover .card-play-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.08);
  background: rgba(255, 255, 255, 0.38);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.28),
    0 3px 10px rgba(0, 0, 0, 0.15),
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    inset 0 -1px 2px rgba(0, 0, 0, 0.06);
}
.card-play-icon svg {
  width: 20px;
  height: 20px;
  fill: #fff;
  margin-left: 3px;
}

/* ---------- 卡片流式加载 ---------- */
.work-card .card-image {
  opacity: 0;
  transition:
    opacity 0.45s ease,
    transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.work-card.is-ready .card-image {
  opacity: 1;
}

.work-card .card-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-tertiary, #aaa);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.35s ease;
}
/* 原写法：只是变透明，动画仍在后台跑 */
.work-card.is-ready .card-loading {
  opacity: 0;
  pointer-events: none;
}

/* 修复：彻底停止动画 + 从渲染树中移除 */
.work-card.is-ready .card-loading {
  opacity: 0;
  pointer-events: none;
  /* 关键：暂停动画，不再消耗 CPU */
  animation-play-state: paused;
}

/* 更彻底：直接让 spinner 停止旋转 */
.work-card.is-ready .loading-spinner {
  animation-play-state: paused;
}

.loading-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--brand, #ffc000);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.work-card.card-failed .card-loading {
  color: #c0563b;
}
.work-card.card-failed .loading-spinner {
  display: none;
}
.work-card.card-failed .card-loading .loading-text::after {
  content: " · 点击重试";
  letter-spacing: 1px;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(36px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- 空态：暂无内容 ---------- */
.works-empty {
  padding: 96px 24px 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--text-tertiary, #aaa);
  animation: cardEnter 0.5s ease both;
}
.works-empty svg {
  width: 52px;
  height: 52px;
  stroke: rgba(0, 0, 0, 0.18);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  margin-bottom: 18px;
}
.works-empty p {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 4px;
}

/* ---------- 加载骨架屏 ---------- */
.skeleton-card {
  position: absolute;
  border-radius: var(--radius-md, 16px);
  background: linear-gradient(
    100deg,
    rgba(0, 0, 0, 0.045) 40%,
    rgba(0, 0, 0, 0.09) 50%,
    rgba(0, 0, 0, 0.045) 60%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
