.yc-alert {
  overflow: hidden;
  width: 100%;
  padding: 8px 15px;
  border-radius: var(--border-radius-small);
  font-size: 14px;
  line-height: 1.5715;
  display: flex;
  align-items: center;
  gap: 8px;
  transform-origin: 50% 0;

  .yc-alert-icon {
    font-size: 16px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .yc-alert-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    .yc-alert-title {
      margin-bottom: 4px;
      font-weight: 500;
      font-size: 16px;
      line-height: 1.5;
      color: var(--color-text-1);
    }
    .yc-alert-content {
      color: var(--color-text-2);
    }
  }
  .yc-alert-close-btn {
    cursor: pointer;
    height: 22px;
    color: var(--color-text-2);
    font-size: 12px;
    transition: color 0.1s cubic-bezier(0, 0, 1, 1);
    display: flex;
    justify-content: center;
    align-items: center;

    .yc-icon-button {
      color: inherit;
    }

    &:hover {
      color: var(--color-text-1);
    }
  }
}
// title
.yc-alert-has-title {
  padding: 15px;
  align-items: flex-start;
  .yc-alert-icon {
    font-size: 18px;
    height: 24px;
  }
}
// center
.yc-alert-center {
  .yc-alert-body {
    .yc-alert-title {
      text-align: center;
    }
    .yc-alert-content {
      text-align: center;
    }
  }
}
// banner
.yc-alert-banner {
  border-radius: var(--border-radius-none);
  justify-content: center;
  .yc-alert-body {
    flex: unset;
  }
}

// type
@types: {
  @info: {
    bg: var(--color-primary-light-1);
    icon: rgb(var(--primary-6));
  };
  @success: {
    bg: var(--color-success-light-1);
    icon: rgb(var(--success-6));
  };
  @warning: {
    bg: var(--color-warning-light-1);
    icon: rgb(var(--warning-6));
  };
  @error: {
    bg: var(--color-danger-light-1);
    icon: rgb(var(--danger-6));
  };
  @normal: {
    bg: var(--color-fill-2);
    icon: var(--color-text-4);
  };
};

each(@types, .(@value, @name) {
  @key: replace(~"@{name}", "@", "");
  .yc-alert-@{key} {
    background-color: @value[bg];
    .yc-alert-icon {
      color: @value[icon];
    }
  }
});
