/* 统一卡片样式 - 移动端适配 */

/* 移动端卡片网格布局 */
@media (max-width: 768px) {
  .discList {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px; /* 列间距 */
    row-gap: 20px; /* 行间距 - 行与行之间10px额外间距 */
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
  }

  /* 统一卡片结构 */
  .discItem {
    margin-bottom: 0 !important;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  /* 覆盖LATEST卡片的额外样式，确保高度一致 */
  .discItem.latest-release,
  .discItem.latest-release0 {
    padding: 10px 0 !important; /* 只保留上下padding，左右为0确保居中 */
    margin-bottom: 0 !important; /* 覆盖原来的40px */
  }

  /* 移动端标签行 - 垂直布局更美观 */
  @media (max-width: 768px) {
    .tag-row {
      min-height: 50px !important;
      display: flex !important;
      flex-direction: column !important;
      justify-content: center !important;
      align-items: center !important;
      padding: 8px 4px !important;
      gap: 4px !important;
    }
  }

  /* 移动端日期和标签样式 */
  @media (max-width: 768px) {
    .tag-row .date {
      font-size: 0.85em !important;
      text-align: center !important;
      line-height: 1 !important;
      color: #ccc !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
    }

    .tag-row .label {
      font-size: 1em !important;
      padding: 6px 12px !important;
      border-radius: 4px !important;
      white-space: nowrap !important;
      text-align: center !important;
      line-height: 1 !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      font-weight: 500 !important;
    }
  }

  /* 图片区域 - 统一高度 */
  .discItem--image {
    height: 140px;
    overflow: hidden;
    border-radius: 6px;
    position: relative; /* 为覆盖层定位 */
  }

  .album-cover {
    border-radius: 6px;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* 移动端LATEST覆盖层样式 */
  .latest-overlay {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.6em;
    font-weight: bold;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  }

  /* 透明LATEST标签样式 */
  .latest-transparent {
    background: linear-gradient(45deg, rgba(255,107,107,0), rgba(255,142,142,0)) !important;
    color: rgba(255,255,255,0) !important;
    animation: none !important;
    box-shadow: none !important;
  }

  /* LATEST标签行 - 统一占位 */
  .latest-badge-row,
  .badge-placeholder {
    min-height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px 0;
  }

  /* LATEST标签文字居中 */
  .latest-badge-row .new-badge {
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* 为所有卡片预留LATEST标签占位空间 */
  .badge-placeholder {
    /* 空占位，保持高度一致 */
    visibility: hidden; /* 隐藏但保留空间 */
  }

  .latest-badge-row {
    visibility: visible; /* LATEST卡片显示标签 */
  }

  /* 标题区域 - 统一高度 */
  .discItem--header {
    min-height: 80px !important; /* 覆盖120px */
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .album-title {
    font-size: 0.9em !important; /* 覆盖1.4em */
    min-height: 2.4em !important; /* 覆盖2.8em */
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
    margin: 0 0 5px 0 !important; /* 覆盖15px 0 5px 0 */
  }

  .album-subtitle {
    font-size: 0.75em !important; /* 覆盖0.9em */
    min-height: 1.2em !important; /* 覆盖1.5em */
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
    margin: 0 !important;
  }

  /* 按钮区域 - 统一高度 */
  .discItem--btn {
    min-height: 50px;
    margin-top: auto !important;
    margin-bottom: 15px !important;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* 覆盖内联样式中的按钮区域设置 */
  .discItem .discItem--btn {
    margin-top: auto !important; /* 覆盖20px */
    margin-bottom: 15px !important; /* 覆盖40px */
    min-height: 50px !important; /* 覆盖60px */
    padding-left: 0 !important; /* 覆盖60px */
    padding-right: 0 !important; /* 覆盖60px */
  }

  /* 按钮样式优化 */
  .service-btn {
    padding: 8px 12px;
    font-size: 0.75em;
    min-width: 120px; /* 增加最小宽度 */
    white-space: nowrap;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .service-btn .btnBuy__text {
    font-size: 0.85em;
    white-space: nowrap;
  }

  .service-btn .btnBuy__icon {
    width: 14px;
    height: 14px;
    margin-right: 4px;
  }

  /* 标签样式优化 */
  .date {
    font-size: 0.85em;
  }

  .label--disc {
    font-size: 0.8em;
    padding: 4px 8px;
  }

  .new-badge {
    font-size: 0.8em;
    padding: 4px 8px;
  }

  /* 配信予定标签样式 */
  .scheduled-badge {
    font-size: 0.8em;
    padding: 4px 8px;
  }
}

/* PC端样式 - 保持原有设计 */
@media (min-width: 769px) {
  /* PC端网格布局 - 添加行间距 */
  .discList {
    row-gap: 20px; /* PC端行间距 */
  }

  /* PC端图片容器不需要相对定位 */
  .discItem--image {
    position: static;
  }

  /* PC端修正item--row宽度问题 */
  .discItem .item--row {
    width: 100% !important; /* 覆盖108% */
    max-width: 100% !important; /* 确保不超出容器 */
  }

  /* 修复flex布局 - 改变justify-content为flex-start */
  .content.disc .discList,
  .st-ContentBody .discList,
  main .discList {
    justify-content: flex-start !important;
    gap: 36px !important; /* 添加间距来替代space-between的间距效果 */
  }

  /* PC端专辑卡片布局 - 每行3个，使用更高优先级的选择器 */
  .content.disc .discList > .discItem,
  .st-ContentBody .discList > .discItem,
  main .discList > .discItem {
    margin: 0 !important;
    margin-top: 80px !important;
    flex-basis: calc(33.33333% - 24px) !important; /* 调整宽度以适应gap */
    -ms-flex-preferred-size: calc(33.33333% - 24px) !important;
  }

  .content.disc .discList > .discItem:nth-child(1),
  .content.disc .discList > .discItem:nth-child(2),
  .content.disc .discList > .discItem:nth-child(3),
  .st-ContentBody .discList > .discItem:nth-child(1),
  .st-ContentBody .discList > .discItem:nth-child(2),
  .st-ContentBody .discList > .discItem:nth-child(3),
  main .discList > .discItem:nth-child(1),
  main .discList > .discItem:nth-child(2),
  main .discList > .discItem:nth-child(3) {
    margin-top: 0 !important;
  }

  /* PC端标签行 - 水平布局 */
  .tag-row {
    min-height: auto;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    gap: 8px;
  }

  /* PC端日期样式 */
  .tag-row .date {
    flex: 1;
    text-align: left;
    font-size: 0.85em;
    color: inherit;
  }

  /* PC端标签样式 */
  .tag-row .label {
    flex-shrink: 0;
    font-size: 0.9em;
    padding: 6px 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* PC端按钮区域确保居中 */
  .discItem .discItem--btn {
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* 修复最后一行专辑排列问题 - 针对第8张专辑的特殊处理 */
  body main .content.disc .discList > .discItem:nth-child(8),
  body main .st-ContentBody .discList > .discItem:nth-child(8),
  body .discList > .discItem:nth-child(8),
  body main .content.disc .discList > .discItem:nth-child(3n + 2):last-child,
  body main .st-ContentBody .discList > .discItem:nth-child(3n + 2):last-child,
  body .discList > .discItem:nth-child(3n + 2):last-child {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* 同时确保最后一行的所有元素都正常排列 */
  body main .content.disc .discList > .discItem:last-child,
  body main .st-ContentBody .discList > .discItem:last-child,
  body .discList > .discItem:last-child {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }



  /* 终极解决方案 - 使用最高优先级强制覆盖所有margin设置 */
  html body main .content.disc .discList > .discItem:nth-child(7),
  html body main .content.disc .discList > .discItem:nth-child(8),
  html body main .st-ContentBody .discList > .discItem:nth-child(7),
  html body main .st-ContentBody .discList > .discItem:nth-child(8) {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 80px !important;
  }
}

/* 平板尺寸特殊处理 */
@media (min-width: 481px) and (max-width: 768px) {
  .service-btn {
    min-width: 140px; /* 平板尺寸更宽的按钮 */
    font-size: 0.8em;
    padding: 10px 16px;
  }

  .service-btn .btnBuy__text {
    font-size: 1em;
    white-space: nowrap;
  }
}

/* 中等平板/小笔记本尺寸特殊处理 */
@media (min-width: 769px) and (max-width: 1024px) {
  .service-btn {
    min-width: 160px; /* 更宽的按钮确保文字不换行 */
    font-size: 0.85em;
    padding: 12px 20px;
    white-space: nowrap;
  }

  .service-btn .btnBuy__text {
    font-size: 1em;
    white-space: nowrap;
  }
}

/* 移动端样式保持不变 */
