def extract_all_css(self, url):         # Fetch the webpage content         try:             response = requests.get(url, timeout=10)             response.raise_for_status()         except requests.RequestException as e:             print(f"Failed to fetch the webpage: {e}")             return [], "", ""                  soup = BeautifulSoup(response.text, 'html.parser')                  # Extract inline styles         inline_styles = [tag.get('style', '') for tag in soup.find_all(attrs={'style': True})]                  # Extract embedded styles         embedded_styles = ' '.join([style.string for style in soup.find_all('style') if style.string])                  # Extract external stylesheet URLs         stylesheet_urls = [link['href'] for link in soup.find_all('link', rel='stylesheet') if 'href' in link.attrs]                  # Fetch and concatenate external stylesheets         external_styles = ''         for stylesheet_url in stylesheet_urls:             absolute_url = urljoin(url, stylesheet_url)             try:                 resp = requests.get(absolute_url, timeout=10)                 resp.raise_for_status()                 external_styles += resp.text + '\n'             except requests.RequestException:                 print(f"Failed to fetch stylesheet: {absolute_url}")                  return soup, inline_styles, embedded_styles, external_styles \n def extract_css_variables(self, stylesheets):         variables = {}         for stylesheet in stylesheets:             parsed_stylesheet = tinycss2.parse_stylesheet(stylesheet, skip_comments=True, skip_whitespace=True)             for rule in parsed_stylesheet:                 if rule.type == 'qualified-rule':                     declarations = tinycss2.parse_declaration_list(rule.content, skip_comments=True, skip_whitespace=True)                     for decl in declarations:                         if decl.type == 'declaration' and decl.name.startswith('--'):                             var_name = decl.name                             var_value = tinycss2.serialize(decl.value).strip()                             variables[var_name] = var_value         return variables          def resolve_css_variable(self, value, variables):         var_pattern = re.compile(r'var\((--[\w-]+)(?:,\s*([^)]+))?\)')         while True:             match = var_pattern.search(value)             if not match:                 break             var_name, fallback = match.groups()             var_value = variables.get(var_name, fallback or '')             value = value[:match.start()] + var_value + value[match.end():]         return value          def extract_color_from_value(self, value):         color_pattern = re.compile(r'(#[0-9a-fA-F]{3,8}|rgba?\([^)]+\)|hsla?\([^)]+\)|\b[a-zA-Z]+\b)')         match = color_pattern.search(value)         return match.group(1) if match else None \n def extract_relevant_css(self, inline_styles, embedded_styles, external_styles):         relevant_properties = {             'background': [                 r'^background(?:-color)?$',                 r'^background-image$',                 r'^background$',             ],             'button': [                 r'^button$',                 r'^\.btn$',                 r'^\.button$',                 r'^\.cta$',                 r'^\.primary$',                 r'^\.secondary$',                 r'^\.action$',                 r'^\.submit$',                 r'^\.link-button$',                 r'^\.custom-button$',                 r'^a\.[\w-]*button[\w-]*$',                 r'^input\[[^\]]*type=["\']?(button|submit)["\']?\]$',                 r'^button\.[\w-]*$',             ],             'text': [                 r'^color$',                 r'^opacity$',             ],             'font': [                 r'^font(?:-family|-size|-weight|-style)?$',                 r'^text-decoration$',                 r'^text-transform$',                 r'^line-height$',                 r'^letter-spacing$',             ],             'body': [                 r'^body$',                 r'^html$',             ],             'variables': [                 r'^--.*?(?:color|font|bg|background|button|text)$',             ],             'other': [                 r'^box-shadow$',                 r'^(?:linear|radial)-gradient$',                 r'^border(?:-color)?$',                 r'^outline(?:-color)?$',             ]}         pattern = '|'.join([f'({item})' for sublist in relevant_properties.values() for item in sublist])         pattern = re.compile(pattern, re.IGNORECASE)                  relevant_css = []                  all_stylesheets = [embedded_styles, external_styles]         variables = self.extract_css_variables(all_stylesheets)                  def get_relevant_declarations(declarations, variables, is_button=False):             relevant_styles = []             for decl in declarations:                 if decl.type == 'declaration':                     property_name = decl.lower_name                     property_value = tinycss2.serialize(decl.value).strip()                     property_value = self.resolve_css_variable(property_value, variables)                                          if pattern.match(property_name) or (is_button and property_name in ['color', 'border-color']):                         relevant_styles.append(f"{property_name}: {property_value};")                                          if property_name == 'background':                         color = self.extract_color_from_value(property_value)                         if color:                             relevant_styles.append(f"background-color: {color};")             return relevant_styles                  combined_styles = embedded_styles + '\n' + external_styles         stylesheet = tinycss2.parse_stylesheet(combined_styles, skip_comments=True, skip_whitespace=True)                  for rule in stylesheet:             if rule.type == 'qualified-rule':                 selector = tinycss2.serialize(rule.prelude).strip()                 declarations = tinycss2.parse_declaration_list(rule.content, skip_comments=True, skip_whitespace=True)                 is_button = any(re.match(btn_pattern, selector) for btn_pattern in relevant_properties['button'])                 relevant_styles = get_relevant_declarations(declarations, variables, is_button)                                  if relevant_styles:                     relevant_css.append(f"{selector} {{\n  " + "\n  ".join(relevant_styles) + "\n}}")                  for i, style_text in enumerate(inline_styles):             if not style_text.strip():                 continue             declarations = tinycss2.parse_declaration_list(style_text, skip_comments=True, skip_whitespace=True)             relevant_styles = get_relevant_declarations(declarations, variables, True)  # Treat all inline styles as potentially button-related                          if relevant_styles:                 relevant_css.append(f"/* inline style {i+1} */ {{\n  " + "\n  ".join(relevant_styles) + "\n}}")                  return "\n\n".join(relevant_css) Hãy cải tiến các hàm này để lấy được nhiều thông tin button color hơn để đạt kết quả chính xác! Hiện tại button color đang bị sai.