/* ============================================
   IDOLM@STER 资源网格
   ============================================ */

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 12px 0;
  contain: layout style;
}

.album-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ====== 强制正方形 ====== */
.album-grid .album-item img,
.album-grid .album-item img[loading],
div.album-grid div.album-item img {
  width: 140px !important;
  height: 140px !important;
  min-width: 140px !important;
  min-height: 140px !important;
  max-width: 140px !important;
  max-height: 140px !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: cover !important;
  border-radius: 6px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  background: #f0f0f0;
  display: block !important;
  margin: 0 auto !important;
  padding: 0 !important;
  cursor: pointer;
  /* 模糊初始态 */
  filter: blur(12px);
  transform: scale(1.05);
  transition: filter 0.5s ease, transform 0.5s ease, box-shadow 0.2s ease;
}

/* 加载完成 → 清晰 */
.album-grid .album-item img.loaded {
  filter: blur(0) !important;
  transform: scale(1) !important;
}

/* hover */
.album-grid .album-item img.loaded:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 曲名 */
.album-item span {
  margin-top: 6px;
  font-size: 11px;
  color: #666;
  line-height: 1.3;
  word-break: break-word;
  max-width: 140px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 无封面 */
.no-cover {
  width: 140px !important;
  height: 140px !important;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #e8e8e8, #d0d0d0);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

/* 折叠面板 */
details {
  border: 1px solid #eaeaea;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 8px 0;
  background: #fcfcfc;
}

details summary {
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: "▶ ";
  display: inline-block;
}

details[open] summary::before {
  content: "▼ ";
}

details[open] summary {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.back-top {
  font-size: 13px;
  color: #999;
  text-decoration: none;
}

.back-top:hover {
  color: #1890ff;
}

/* 移动端 */
@media (max-width: 480px) {
  .album-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }
  .album-grid .album-item img,
  .album-grid .album-item img[loading],
  div.album-grid div.album-item img {
    width: 100px !important;
    height: 100px !important;
    min-width: 100px !important;
    min-height: 100px !important;
    max-width: 100px !important;
    max-height: 100px !important;
  }
  .no-cover {
    width: 100px !important;
    height: 100px !important;
  }
  .album-item span {
    font-size: 10px;
    max-width: 100px;
  }
}