// 主容器样式
.materialContainer {
  padding: 24px;
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

// 头部样式
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 8px;

  h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .headerActions {
    display: flex;
    gap: 12px;
  }
}

// 按钮样式
.actionButton {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);

  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  }

  &:active {
    transform: translateY(0);
  }

  :global(.anticon) {
    font-size: 14px;
  }
}

.importButton {
  background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
  box-shadow: 0 2px 8px rgba(82, 196, 26, 0.3);

  &:hover {
    box-shadow: 0 4px 12px rgba(82, 196, 26, 0.4);
  }
}

// 主内容区域
.cgMain {
  display: flex;
  gap: 24px;
  margin-top: 24px;
}

// 左侧边栏样式
.sidebar {
  width: 280px;
  flex-shrink: 0;
}

.sidebarTitle {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 16px;
  padding: 0 8px;
}

// 组列表容器
.groupListContainer {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

// 组列表项
.groupItem {
  cursor: pointer;
  background: #fafbfc;
  border-radius: 12px;
  margin-bottom: 8px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  padding: 16px !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 70px;
  position: relative;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);

    &::before {
      opacity: 1;
    }
  }
}

.selected {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%) !important;
  border-color: #667eea !important;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);

  &::before {
    opacity: 1;
  }
}

// 组名称
.groupName {
  font-weight: 600;
  font-size: 16px;
  color: #2c3e50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  margin-bottom: 8px;
  z-index: 2;
  position: relative;
}

// 描述和类型信息
.descTypeInfo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  z-index: 2;
  position: relative;
  
  span:first-child {
    font-size: 13px;
    color: #7f8c8d;
    line-height: 1.4;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
  }
}

// 类型标签
.typeTag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
  flex-shrink: 0;
}

// 操作按钮组
.groupActions {
  display: flex;
  gap: 6px;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 3;
  pointer-events: none;
}

.groupItem.showActions .groupActions {
  opacity: 1;
  pointer-events: auto;
}

.groupActionBtn {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: #667eea;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 2px;
  backdrop-filter: blur(10px);

  &:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  }
}

// 右侧内容区域
.contentArea {
  flex: 1;
  min-width: 0;
}

.contentHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: white;
  padding: 20px 24px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);

  .contentTitle {
    font-weight: 600;
    font-size: 18px;
    color: #2c3e50;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .contentActions {
    display: flex;
    gap: 12px;
  }
}

// 素材列表容器
.materialListContainer {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  min-height: 400px;
}

// 空状态样式
.emptyState {
  text-align: center;
  padding: 60px 20px;
  color: #7f8c8d;

  .emptyIcon {
    font-size: 64px;
    color: #bdc3c7;
    margin-bottom: 16px;
    
    :global(.anticon) {
      transition: all 0.3s ease;
      
      &:hover {
        color: #667eea;
        transform: scale(1.1);
      }
    }
  }

  h3 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
  }

  p {
    color: #7f8c8d;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
  }
}

// 素材卡片样式
.materialCard {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #f0f0f0;
  position: relative;

  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;

    .cardActions {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .cardMain {
    cursor: pointer;
  }

  .cardCover {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  }

  .cardContent {
    padding: 16px;

    .cardTitle {
      font-weight: 600;
      font-size: 16px;
      color: #2c3e50;
      margin: 0 0 8px 0;
      line-height: 1.3;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .cardDesc {
      color: #7f8c8d;
      font-size: 13px;
      line-height: 1.4;
      margin: 0 0 12px 0;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .cardMeta {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 12px;

      .typeLabel {
        color: #667eea;
        font-weight: 500;
      }

      .statusLabel {
        padding: 2px 8px;
        border-radius: 4px;
        font-weight: 500;

        &.generating {
          background: rgba(250, 173, 20, 0.1);
          color: #faad14;
        }

        &.completed {
          background: rgba(82, 196, 26, 0.1);
          color: #52c41a;
        }
      }
    }
  }

  .cardActions {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10;

    .editButton {
      background: rgba(255, 255, 255, 0.9);
      border: none;
      border-radius: 6px;
      color: #667eea;
      font-size: 12px;
      padding: 4px 8px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      backdrop-filter: blur(10px);

      &:hover {
        background: rgba(255, 255, 255, 1);
        color: #5a6fd8;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      }

      :global(.anticon) {
        font-size: 12px;
        margin-right: 4px;
      }
    }
  }
}

// 媒体卡片样式（弹窗中使用）
.mediaCard {
  background: #f7f8fa;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  min-width: 120px;
  text-align: center;
  position: relative;

  &:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
  }

  .cardContent {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
  }
}

// 响应式设计
@media (max-width: 768px) {
  .cgMain {
    flex-direction: column;
    gap: 16px;
  }

  .sidebar {
    width: 100%;
  }

  .materialListContainer {
    padding: 16px;
  }

  .contentHeader {
    padding: 16px;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;

    .contentActions {
      justify-content: center;
    }
  }
}

// 全局样式覆盖
.materialContainer {
  :global {
    .ant-list-item {
      border: none !important;
      padding: 0 !important;
    }

    .ant-card {
      border: none;
      border-radius: 12px;
    }

    .ant-card-body {
      padding: 0;
    }

    .ant-modal {
      .ant-modal-content {
        border-radius: 16px;
        overflow: hidden;
      }

      .ant-modal-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        
        .ant-modal-title {
          color: white;
          font-weight: 600;
        }
      }

      .ant-modal-close {
        color: white;
        
        &:hover {
          color: rgba(255, 255, 255, 0.8);
        }
      }
    }

    .ant-btn-primary {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border: none;
      border-radius: 8px;
      font-weight: 500;
      box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);

      &:hover {
        background: linear-gradient(135deg, #5a6fd8 0%, #6a5a94 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
      }
    }

    .ant-form-item-label > label {
      font-weight: 600;
      color: #2c3e50;
    }

    .ant-input,
    .ant-input-affix-wrapper,
    .ant-select-selector {
      border-radius: 8px;
      border: 1px solid #e0e6ed;
      transition: all 0.3s ease;

      &:hover {
        border-color: #667eea;
      }

      &:focus,
      &.ant-input-affix-wrapper-focused,
      &.ant-select-focused .ant-select-selector {
        border-color: #667eea;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
      }
    }

    .ant-spin-container {
      min-height: 200px;
    }
  }
} 